Re: [go-nuts] Why does Go not include a stack trace by default in the errors package?

2018-08-06 Thread 'Axel Wagner' via golang-nuts
The message from an `error` is not for consumption by a developer, trying to find a bug in their program, but for consumption by a user/operator, trying to find out what caused a failure. They may seem similar use-cases, but in general, the latter finds stack traces incredibly useless and

[go-nuts] Why does Go not include a stack trace by default in the errors package?

2018-08-06 Thread 'Anmol Sethi' via golang-nuts
Such traces can be extremely useful for debugging an error caused deep inside some library. Does Go opt not to do this by default in the errors package because of the performance implications? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Why does Go not include a stack trace by default in the errors package?

2018-08-06 Thread Rob Pike
My thinking is part of the discussion in https://commandcenter.blogspot.com/2017/12/error-handling-in-upspin.html -rob On Tue, Aug 7, 2018 at 7:43 AM, 'Axel Wagner' via golang-nuts < golang-nuts@googlegroups.com> wrote: > The message from an `error` is not for consumption by a developer,

Re: [go-nuts] Re: avoiding os thread creation due to logging

2018-08-06 Thread Anuj Agrawal
I am not sure if that is indeed a better solution. I am probably better off delegating the responsibility of writing logs to a dedicated goroutine. On Sun, Aug 5, 2018 at 10:51 PM, wrote: > You can use a semaphore-like pattern described in > https://tip.golang.org/ref/mem to limit the number of

Re: [go-nuts] Re: looking for a flexible file path resolver

2018-08-06 Thread DrGo
Thanks Marvin, There are situations where you need to check (and report back to the user) for file existence no matter how you do that (using Stat or by attempting to open or create it). There are several issues with the approach you described, which is essentially what fileapth.Abs() does,

[go-nuts] [ANNOUNCE] Moving "etcd" to its own GitHub org

2018-08-06 Thread Gyuho Lee
Hello Go community, We are moving all etcd projects (including coreos/bbolt ) to github.com/etcd-io. For example, github.com/coreos/etcd will be transferred to github.com/etcd-io/etcd , on *August 27,

[go-nuts] Go Install

2018-08-06 Thread John More
following the tutorial at https://golang.org/doc/code.html the go install I am confused by the following statement: Whenever the go tool installs a package or binary, it also installs whatever dependencies it has. So when you install the hello program $ *go install github.com/user/hello* the

Re: [go-nuts] Go Install

2018-08-06 Thread John More
You are right, using the -i option did the deed. Thanks John On Tue, Aug 7, 2018 at 1:26 AM, Ian Lance Taylor wrote: > On Mon, Aug 6, 2018 at 7:09 PM, John More wrote: > > following the tutorial at https://golang.org/doc/code.html the go > install I > > am confused by the following statement:

[go-nuts] Re: WebSocket implementation in Go

2018-08-06 Thread Liviu G
Hey, thanks for sharing ! I remember reading about it on your blog, awesome job. On Sunday, August 5, 2018 at 8:19:01 PM UTC+2, Sergey Kamardin wrote: > > Hi Gophers, > > I have released a stable v1.0 version of https://github.com/gobwas/ws. > > It implements RFC6455 and supports streaming,

Re: [go-nuts] Caling windows DLL func from go :: parameter is incorrect

2018-08-06 Thread amit . limaye
layer is an enum in the dll. Gets converted to uint32 inside the dll before it makes the windows api call. priority is exposed as int16 in the exported dll api Regards Amit On Saturday, August 4, 2018 at 10:53:40 AM UTC-7, Oryan Moshe wrote: > > Seems to me like type issues as well, doesn't

Re: [go-nuts] Caling windows DLL func from go :: parameter is incorrect

2018-08-06 Thread Oryan Moshe
It doesn't look like you turn it to const anywhere, just a pointer. Is the pointer conversion returning a const? On Mon, Aug 6, 2018, 18:46 Amit Limaye wrote: > is the const char * a problem my string is not passed as const ? > -SIGTERM > amit > > Humanity's first sin was faith, Its first

Re: [go-nuts] Re: looking for a flexible file path resolver

2018-08-06 Thread Marvin Renich
* DrGo [180806 02:00]: > Thanks, > filepath.Abs does some of what I want, but as far as I could tell, it does > not handle resolving relative paths Does this code help out? if filepath.IsAbs(somepath) { somepath = filepath.Clean(somepath) } else { var wd, err = os.Getwd() if err !=

Re: [go-nuts] Caling windows DLL func from go :: parameter is incorrect

2018-08-06 Thread Amit Limaye
is the const char * a problem my string is not passed as const ? -SIGTERM amit Humanity's first sin was faith, Its first virtue doubt On Mon, Aug 6, 2018 at 8:33 AM wrote: > > layer is an enum in the dll. > Gets converted to uint32 inside the dll before it makes the windows api call. >

Re: [go-nuts] Caling windows DLL func from go :: parameter is incorrect

2018-08-06 Thread Amit Limaye
the dll exported function signature takes a const char * while I am passing a string my golang call signature Open(lazyP*syscall.LazyProc, filter string, layer uint32, priority int16, flags uint64) error which I use to make this call r1, r2, lastError :=

[go-nuts] Re: Go not exists as Technology in Google Developers Experts

2018-08-06 Thread Luis Furquim
That's strange. Manually searching the page (looking for go, think how many times we find "Google" occurrences ...) I found these enlisting Go skills: https://developers.google.com/experts/people/ashley-mcnamara https://developers.google.com/experts/people/ernesto-jimenez

Re: [go-nuts] CGO - convert a c.char array to string

2018-08-06 Thread Ian Lance Taylor
On Sun, Aug 5, 2018 at 10:29 PM, nicolas_boiteux via golang-nuts wrote: > > thanks you, the A3 community finaly help me to solve the last problem > > for index := C.int(0); index < argc; index++ { > out = append(out, C.GoString(*argv)) > argv =

[go-nuts] [ANN] go-set type-safe sets for Go

2018-08-06 Thread henrik
Go-set is a type-safe, zero-allocation set implementation for Go. https://github.com/scylladb/go-set At Scylla we are long time users of https://github.com/fatih/set and after it’s discontinuation we wanted to still use it. We therefore created an enhanced clone with a typesafe API and high

Re: [go-nuts] Caling windows DLL func from go :: parameter is incorrect

2018-08-06 Thread Oryan Moshe
Can you try casting your string to a c char? (*C.char)(unsafe.Pointer(string)) On Mon, Aug 6, 2018, 18:54 Amit Limaye wrote: > the dll exported function signature takes a const char * > while I am passing a string > my golang call signature > > Open(lazyP*syscall.LazyProc, filter string, layer