Re: [go-nuts] how to control the timezone of time.Now()

2021-10-27 Thread Uli Kunitz
I believe time.Local = time.UTC is the right approach. It is true that the loc field of the time structure will be set to &UTC and not zero, but I couldn't find a path where this should generate a problem. From my point of view I would regard any issue resulting from it as a bug. Uli On Thursd

Re: [go-nuts] Does, or Will, Go Support Initialized .data Segments?

2021-10-27 Thread Ian Lance Taylor
On Wed, Oct 27, 2021 at 4:14 PM jlfo...@berkeley.edu wrote: > > So is it true that package level initializations (that are used) require no > runtime, other than some loader > time to set up? It depends. Go initializers are arbitrarily complex. The compiler will do them at compile time if poss

Re: [go-nuts] how to control the timezone of time.Now()

2021-10-27 Thread Ian Lance Taylor
On Wed, Oct 27, 2021 at 4:28 PM Radu Berinde wrote: > > > The argument here > is that a program would only call the UTC method if it wants to change > the way that those conversions work, so it presumably cares about the > wall time, not monotonic time. > > But in those contexts, the monotonic tim

[go-nuts] Re: no replace directive allowed for "go install" ?

2021-10-27 Thread Zik Aeroh
All replaces are disallowed when using "go install" with a version number, regardless of what kind they are; see https://github.com/golang/go/issues/40276, specifically the sections about "replace". I have a tool I'm currently rewriting that manages $GOBIN via a config file; I'm relying on "go

Re: [go-nuts] how to control the timezone of time.Now()

2021-10-27 Thread 'Radu Berinde' via golang-nuts
Hi Ian, > The argument here is that a program would only call the UTC method if it wants to change the way that those conversions work, so it presumably cares about the wall time, not monotonic time. But in those contexts, the monotonic time wouldn't make a difference - so what is the upside of s

Re: [go-nuts] Does, or Will, Go Support Initialized .data Segments?

2021-10-27 Thread jlfo...@berkeley.edu
You're right, of course. Thanks. So is it true that package level initializations (that are used) require no runtime, other than some loader time to set up? Jon On Wednesday, October 27, 2021 at 3:54:08 PM UTC-7 Ian Lance Taylor wrote: > On Wed, Oct 27, 2021 at 3:34 PM jlfo...@berkeley.edu >

Re: [go-nuts] how to control the timezone of time.Now()

2021-10-27 Thread Ian Lance Taylor
On Wed, Oct 27, 2021 at 3:37 PM Andrei Matei wrote: > > At least for my edification, though, I would benefit from a commentary > about why exactly it is that UTC() strips the monos, if you happen to > understand it. The only thing comment on the topic I found is here, from Russ: > He said: > > I s

Re: [go-nuts] Does, or Will, Go Support Initialized .data Segments?

2021-10-27 Thread Ian Lance Taylor
On Wed, Oct 27, 2021 at 3:34 PM jlfo...@berkeley.edu wrote: > > I'm asking because preinitializing an executable binary, where possible, > seems like an obvious optimization. > I'm writing baby programs as I'm learning Go, but even they have a > significant (to me) number of initializations > th

Re: [go-nuts] how to control the timezone of time.Now()

2021-10-27 Thread 'Andrei Matei' via golang-nuts
On Tue, Oct 26, 2021 at 6:09 PM Ian Lance Taylor wrote: > On Tue, Oct 26, 2021 at 2:07 PM Andrei Matei > wrote: > > > > If you accept that there are reasons for setting TZ for a particular > program, then > > would you also agree that there are reasons for wanting to do the same > from inside >

Re: [go-nuts] Does, or Will, Go Support Initialized .data Segments?

2021-10-27 Thread jlfo...@berkeley.edu
I'm asking because preinitializing an executable binary, where possible, seems like an obvious optimization. I'm writing baby programs as I'm learning Go, but even they have a significant (to me) number of initializations that don't need to take up any execution time. On the other hand, modern c

Re: [go-nuts] Does GC pause affect non-go threads spawned by CGo?

2021-10-27 Thread 'drc...@google.com' via golang-nuts
The pause also tends to not be large. Except for bugs (which do exist and some of them are hard to fix) the goal on a modern fast processor is under 100 microseconds of a thread "pausing". There is a period of time where goroutines will make reduced progress as the garbage collector steals ei

Re: [go-nuts] Does, or Will, Go Support Initialized .data Segments?

2021-10-27 Thread Kurtis Rader
On Wed, Oct 27, 2021 at 10:49 AM jlfo...@berkeley.edu < jlforr...@berkeley.edu> wrote: > I've noticed that Go doesn't seem to support the intialized .data segment > that I used to find on Unix. Is this correct? I've tried using various Go > tools to find out but I'm not sure what I was seeing. > >

[go-nuts] Does, or Will, Go Support Initialized .data Segments?

2021-10-27 Thread jlfo...@berkeley.edu
I've noticed that Go doesn't seem to support the intialized .data segment that I used to find on Unix. Is this correct? I've tried using various Go tools to find out but I'm not sure what I was seeing. If it isn't supported now, is this something planned for the future? Cordially, Jon Forrest

[go-nuts] no replace directive allowed for "go install" ?

2021-10-27 Thread 'Sebastien Binet' via golang-nuts
hi there, I was updating instructions to install binaries for a package of mine, with Go modules enabled. and I got: $> cd /tmp/dir $> go install -v go-hep.org/x/hep/cmd/root2yoda@latest go: downloading go-hep.org/x/hep v0.29.2 go: go-hep.org/x/hep/cmd/root2yoda@latest (in go-hep.org/x/hep@v0.29

Re: [go-nuts] Re: How to negotiate authentication over HTTP ? (the Go way)

2021-10-27 Thread Amnon
The design of the client side of net/http is not great , and requires a lot of boilerplate. I don't know of any approach which is better than your DoHTTPRequestWithAuthenticationHandling (though I would have chosen a very much