[go-nuts] Re: DisableKeepAlive not being honored in http.transport

2020-05-06 Thread Amnon Baron Cohen
Connections are indeed reused where possible by default in the Go standard library. But as http (before http2) does not support multiplexing, it is not possible to reuse a connection which is still in use (i.e. which is still in the process of reading the response). These means that the body of

[go-nuts] Re: flags package: shared flags and flag sets

2020-05-06 Thread mural
https://play.golang.org/p/Sga78gMLn-9 You can then use it like './mycli -d stream -rt' The '-d' option is a shared flag, and `-rt' is dedicated for the subcommand 'stream'. On Wednesday, May 6, 2020 at 8:08:25 PM UTC+8, Chris Burkert wrote: > > Dear all, > > I'd like to mix shared flags with

Re: [go-nuts] log.SetOutput doc improvement

2020-05-06 Thread Kevin Chadwick
On 2020-05-06 18:03, Kevin Chadwick wrote: >> If you use log.SetOutput within a go routine, even if you delay main to make >> sure there is no race. Then mains following log.Print and following >> functions or >> executions log output are not redirected? > If you expect this should work Seems it

Re: [go-nuts] Why is there no instruction rescheduling?

2020-05-06 Thread Ian Lance Taylor
On Wed, May 6, 2020 at 12:32 AM Richard Gong wrote: > > Yes, I noticed that the optimization passes are concise as compared to other > compilers, especially those "Sea of Nodes" compilers. Gc's escape analysis > and inlining were based on AST. Do you think it's a drawback for deeper >

Re: [go-nuts] terminating goruntime internal threads

2020-05-06 Thread Ian Lance Taylor
On Wed, May 6, 2020 at 10:02 AM Pavan wrote: > > Thanks Ian. I start some 20 go routines and each routine involves calling C > functions and finally all go routines terminate. since each goroutine uses > LockOSThread at the begining, all the pthreads spawned as part of goroutines > exit too. >

Re: [go-nuts] Compiling hello.go: "fatal error: unexpected signal during runtime execution"

2020-05-06 Thread Ian Lance Taylor
On Wed, May 6, 2020 at 9:31 AM dubadub wrote: > > I'm trying to compile hello.go on an old(-ish) Linux but getting a random > error every time: "fatal error: unexpected signal during runtime execution" > or "fatal error: runtimer: bad p". > > I appreciate any idea where to dig. > What version

[go-nuts] DisableKeepAlive not being honored in http.transport

2020-05-06 Thread Ryan Rank
I wrote a small program that runs a repeated GET against a given URL. However, the DisableKeepAlives boolean does not seem to be honored. Code is similar to this: transport := { DisableKeepAlives: false, } client := { Transport: transport, } for i := 0; i < 10; i++ { _, err :=

[go-nuts] Re: handling constant of maps

2020-05-06 Thread 'Kevin Chowski' via golang-nuts
I would do (and have done) what you suggested in your last example, but just put the codes into a 'var' block as opposed to a const block, e.g.: var ( >E270_01 = ErrorCode{"270.01", "this is error description"} ) I would not personally be concerned about people modifying that public

Re: [go-nuts] log.SetOutput doc improvement

2020-05-06 Thread Kevin Chadwick
On 2020-05-06 17:57, Kevin Chadwick wrote: > If you use log.SetOutput within a go routine, even if you delay main to make > sure there is no race. Then mains following log.Print and following functions > or > executions log output are not redirected? If you expect this should work then perhaps I

Re: [go-nuts] log.SetOutput doc improvement

2020-05-06 Thread Kevin Chadwick
On 2020-05-06 16:54, Ian Lance Taylor wrote: > Sorry, can you show an example of what you mean? As far as I can > tell, you can call log.SetOutput multiple times, and it will affect > all subsequent output of the standard logger, up to the next call to > log.SetOutput. Indeed and I am perfectly

Re: [go-nuts] terminating goruntime internal threads

2020-05-06 Thread Pavan
Thanks Ian. I start some 20 go routines and each routine involves calling C functions and finally all go routines terminate. since each goroutine uses LockOSThread at the begining, all the pthreads spawned as part of goroutines exit too. Now i see around 34 goroutines, few of them have stack

Re: [go-nuts] log.SetOutput doc improvement

2020-05-06 Thread Ian Lance Taylor
On Wed, May 6, 2020 at 8:44 AM Kevin Chadwick wrote: > > "https://godoc.org/log#SetOutput": > "SetOutput sets the output destination for the standard logger." > > To me, without clarification, I assumed it would be globally re-directable at > multiple times if desired, but it is only globally

[go-nuts] go swagger client code usage

2020-05-06 Thread RS
Hi, via *swagger generate client -f file.json* I have created client side golang codes. The question is how can I use those generated codes for each REST API in my golang project as consumer. As a golang/swagger-newbie an example would be appreciated. Thanks Larisa -- You received this

[go-nuts] log.SetOutput doc improvement

2020-05-06 Thread Kevin Chadwick
"https://godoc.org/log#SetOutput": "SetOutput sets the output destination for the standard logger." To me, without clarification, I assumed it would be globally re-directable at multiple times if desired, but it is only globally effective when ran early from main. I don't understand why it is

[go-nuts] flags package: shared flags and flag sets

2020-05-06 Thread Tamás Gulácsi
See how pkg https://go.dev/github.com/peterbourgon/ff/v3/ffcli does it -- 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+unsubscr...@googlegroups.com.

[go-nuts] flags package: shared flags and flag sets

2020-05-06 Thread Chris Burkert
Dear all, I'd like to mix shared flags with flags specific to flag sets (cooltool ). However I struggle to parse the shared flags only and pass the rest to the flagset for parsing. Here is what I came up with: https://play.golang.org/p/Jazn3aSX9-d Do I have to pick a different flag library or

Re: [go-nuts] Build fails when following build instructions

2020-05-06 Thread eric fang
well done. Expect it to be merged. Thanks. 在 2020年5月6日星期三 UTC+8下午7:18:21,Than McIntosh写道: > > >This seems to be the synchronization problem of gollvm and llvm, I am > fixing it today, if you have not done it, I can help. > > Thanks, I have started a CL for this -- it is at >

Re: [go-nuts] Build fails when following build instructions

2020-05-06 Thread 'Than McIntosh' via golang-nuts
>This seems to be the synchronization problem of gollvm and llvm, I am fixing it today, if you have not done it, I can help. Thanks, I have started a CL for this -- it is at https://go-review.googlesource.com/c/gollvm/+/232497 if you want to look it over. Not quite done yet, still a few things to

Re: [go-nuts] Build fails when following build instructions

2020-05-06 Thread eric fang
This seems to be the synchronization problem of gollvm and llvm, I am fixing it today, if you have not done it, I can help. 在 2020年5月5日星期二 UTC+8下午8:30:14,Than McIntosh写道: > > OK, thanks for that. I will investigate, this looks unrelated to the > previous problem. Stay tuned. > > Cheers, Than >

Re: [go-nuts] Why is there no instruction rescheduling?

2020-05-06 Thread Richard Gong
Thank you for your information, Ian. Yes, I noticed that the optimization passes are concise as compared to other compilers, especially those "Sea of Nodes" compilers. Gc's escape analysis and inlining were based on AST. Do you think it's a drawback for deeper optimization? Any future plan to