hiram.001 | 24 Nov 19:29 2014
Picon

Recovering from nested import panic

Hi everyone.

I have something like this

/* File: a.go */
package a

func funcThatPanics(){
}


/* File: b.go */
package b

import "a"

func Handle() {
 a.funcThatPanics()
}

/* file: c.go */
package main

import "b"

func main() {
 defer handlePanic()

  b.Handle()
}

func panicHandle(){
  if r := recover(); r != nil { main() }
}


But fails to catch the panic originated from a.
Any suggestion?

Thanks

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
stpra123 | 24 Nov 19:34 2014
Picon

"no such host" with many get requests

Please forgive the newb-ness of this question.

I ran into the "no such host" issue described at https://code.google.com/p/go/issues/detail?id=3575#makechanges. I was told to post here.

In short, I tried the "go install -a -tags netgo net my-pkg" workaround but get a permission denied error. I eventually reinstalled go as as that led to other errors (see the post for more details).

Another proposed solution there is to mutex net.cgoLookupIPCNAME. How do I modify http://play.golang.org/p/C1WhYh4_jl to lock net.cgoLookupIPCNAME? (I do realize it won't run on the playground)

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Drew Wells | 24 Nov 18:36 2014
Picon

compiling c libraries with cgo

I'm trying to compile libsass dependency as part of go get.  From what I can tell, cgo only works after fully compiling libsass (c library) static library prior to running go get.

Is cgo able to compile the static library as part of building Go?
Is it possible to provide static libraries for non-host platforms for linking to cross compiled Go code?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Jason E. Aten | 24 Nov 17:38 2014
Picon

a safe free of memory proposal, runtime.FreeMemory()

I'm considering how to allow performance optimization of memory freeing in Go; my current GC pause times for one application average 750 - 1500 msec, which makes these pauses a bit troublesome.  It seems to me like programmers should be able to provide hints to the garbage collector. Often times I know I'm done with this block of memory, and my knowledge is currently wasted, resulting in long GC pauses.

What if there was a runtime.FreeMemory(*T) operation in Go, that depended on three states of the system:

In Sandboxed environments, runtime.FreeMemory() is a noop. That way it is impossible to crash the program in a sandbox by early free of memory.

In non-sandboxed environments, suppose we have (I'm making up a variable name:) unsafe.MemoryFreeAllowed = CHECK_FREE. If this variable is set to CHECK_FREE, then the garbage collector will simply note the FreeMemory() invocation stack trace, and on the next scan, if that memory was not in fact free, will panic with a report indicating that the FreeMemory() call was erroneous, and give the saved stack trace. The effect would be to allow the program to run with production loads, and to verify that, under those loads, the hints were always correct.

Finally, also in non-sandboxed environments, one can set the performance setting of unsafe.MemoryFreeAllowed = FREE_INSTANTLY. With FREE_INSTANTLY (also a non-zero not-default value), then the memory is freed immediately without waiting for GC to verify. This is unsafe, as it can crash your program, but could readily and radically reduce pause times when the programmer is providing correct FreeMemory() advice.

It's optional. It's safe when sandboxed.  It lets Go venture into application territory that is owned by C++ currently.

-Jason

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
riya6 csr | 24 Nov 15:43 2014
Picon

Qlikview, Tableau, OBIEE etc..

Dear Partner,

Presenting you the skilled and energetic own w2 consultants. All available immediately for your directly client requirements.

 

Please shower your requirement to riya-PUu0ith1B1oRJS1jRW8iBQ@public.gmane.org

 

Primary SKILL

LOCATION

RELOCATION

AVAILABILITY

Qlikview Developer

WA

CA

Immediately

Project Manager

CT

open

Immediately

Cognos Lead

CA

Bay area

Immediately

Informatica Dev

IA

open

Immediately

Tableau consultant

PA

open

Immediately

VMWare Admin

CA

open

Immediately

Salesforce Developer

TX

CA

Immediately

OBIEE

WA

open

Immediately

Java Developer

OH

Open

Immediately

Business Analyst

NJ

open

Immediately

Oracle DBA

VA

open

Immediately

SAS

MI

open

Immediately

 

 

"The best way to reach me is via email"

Thanks & Regards

R I Y A
Resource Manager
CSR InfoTech INC
riya-PUu0ith1B1rc+919tysfdA@public.gmane.org
GTalk: riya.csrinfotech

E-Verify Certified Company 

Disclaimer: We respect your Online Privacy. This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. If you are not interested in receiving our e-mails then please reply with a "REMOVE" in the subject line at riya-PUu0ith1B1rc+919tysfdA@public.gmane.org  and mention all the e-mail addresses to be removed with any e-mail addresses, which might be diverting the e-mails to you. We are sorry for the inconvenience

 

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Thomas King | 24 Nov 14:25 2014
Picon

[BUG] string comparison not working as expected.

_, error := connection.Read(buffer) buffer := make([]byte, BUFFER_SIZE) splited := strings.Split(string(buffer), " ") switch splited[0] { case "TEST": connection.Write([]byte("TEST CONNECTION OK")) log.Printf("TEST COMMAND") break;If I write "TEST" in client, the server will not enter the case statement. But if I send "TEST SOMETHING" from client, the server will enter the case as expected. Is this a bug of go-lang?
I printed splited[0]+"aaa" and it's just "TESTaaa", nothing seems wrong.  Also tested with if splited[0] == "TEST", all failed

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Forud A | 24 Nov 06:32 2014
Picon

[ANN] tmass , no dependency tmux session manager

https://github.com/fzerorubigd/tmass

A simple, no-dependency tool for load and save tmux sessions.
  • load session files and manage window and pane and run commands inside each pane
  • save an active session into a file, with some limitation (commands are not reported correctly by tmux)

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
nicolas riesch | 24 Nov 00:47 2014
Picon

TimedWait() for condition variable in sync package ?

There is no TimedWait(timeout) function that returns after a timeout has elapsed, when waiting on a condition variable.

Is there a reason, or another way to achieve the same result ?


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Nick Patavalis | 23 Nov 19:52 2014
Picon

Select statement execution, rationale

Hello gophers,

Reading from the language spec:

For all the cases in the statement, the channel operands of receive operations and the channel *and right-hand-side expressions of send statements* are evaluated exactly once, in source order, upon entering the "select" statement. The result is a set of channels to receive from or send to, and the corresponding values to send.

I admit, the emphasized part caught me by surprise. Why? I would expect the right-hand-side part of send statements to be evaluated *only* when the case selected. This would allow someone to do something like:

case out <- q.Pop():

Now you have to mess with temporary variables and the code gets uglier.

I understand that it is how it is, but I'm wondering, is there any reason it was chosen to be so?

/npat 

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Gyu-Ho Lee | 23 Nov 18:11 2014
Picon

[Baby Gopher] Best practice in package hierarhcy

Is there any good article on structuring go package hierarchy?

I see in `net` package, `net/http` package uses its parental(in terms of path) package `net` and other packages in the same level (`net/textproto`).

Then is it discouraged, even without circular dependency, for a package to call child package? For example, `net` package would call `net/helpers` package if exists?

What is the best practice in go package structure? Thanks all. I love Go!

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
ama mm | 23 Nov 14:29 2014
Picon

rfc: Insert Delete Ordered Slice v0.1

The eventual goal of this project is to make the container/list and container/ring obsolete.
I'd like you to review the version v0.1 of this api and the implementations.
  • generic - uses slice tricks via reflection: for slices of the form: var foo [1][]mytype
  • seq2 - uses a gap buffer: for slices of the form: var bar [2][]byte
please, try the /example/editor/ demo.
this is how to iterate on the h container:

   
var h[2][]byte

   
for i, err := S2B(h).At(0); err == nil; i, err = S2B(h).Rewind(i, 1) {
        h
[i[0]][i[1]]  // this is how to access an individual element
   
}




do you like this approach? Variable i is an indexer. Do you like the indexer concept?



--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Gmane