Re: [go-nuts] Changing channel from unbuffered to buffered prevents goroutine from running

2022-02-10 Thread Ian Lance Taylor
On Thu, Feb 10, 2022, 9:52 PM Dean Schulze wrote: > Here is an exercise using channels and select in a goroutine. If the > disconnect channel is changed to a buffered channel the goroutine doesn't > run at all. > > Why does changing from an unbuffered to a buffered channel prevent running > the

[go-nuts] Changing channel from unbuffered to buffered prevents goroutine from running

2022-02-10 Thread Dean Schulze
Here is an exercise using channels and select in a goroutine. If the disconnect channel is changed to a buffered channel the goroutine doesn't run at all. Why does changing from an unbuffered to a buffered channel prevent running the goroutine? *

[go-nuts] Having trouble getting app to build with Docker after moving to a "src" directory

2022-02-10 Thread David Karr
I had a small go application building successfully. I had the go.mod and main.go in the root directory of the project, and I was building it pretty easily with a Makefile, which just did the following: CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o target/dist/linux-amd64 I decided I

[go-nuts] Possible fix to glog's flag-pollition problem

2022-02-10 Thread Gurjeet Singh
This problem of glog polluting users' options has been reported quite a few times over the years; for example, see it reported at golang-nuts mailing list [1], and cue lang issue [2]. [1]: https://groups.google.com/g/golang-nuts/c/vj8ozVqemnQ [2]: https://github.com/cue-lang/cue/issues/1199 The

[go-nuts] [security] Go 1.17.7 and Go 1.16.14 are released

2022-02-10 Thread Cherry Mui
Hello gophers, We have just released Go versions 1.17.7 and 1.16.14, minor point releases. These minor releases include three security fixes following the security policy : - crypto/elliptic: fix IsOnCurve for big.Int values that are not valid coordinates

[go-nuts] Capturing http server TLS handshake error

2022-02-10 Thread Victor
Is there a way to capture/hook http.Server TLS handshake error? I mean overriding/catching the line: c.server.logf("http: TLS handshake error from %s: %v", c.rwc.RemoteAddr(), err) in /net/http/server.go -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Re: DataRace with slice, should i fix it or ignore it?

2022-02-10 Thread 'Dan Kortschak' via golang-nuts
On Thu, 2022-02-10 at 09:15 -0800, jake...@gmail.com wrote: > > On Wednesday, February 9, 2022 at 9:14:52 AM UTC-5 peterGo wrote: > > Pelen Li, > > > > Always fix your data races. You should consider the results of data > > races as undefined. > > > > Dmitry Vyukov, who implemented the Go race

Re: [go-nuts] Golang application local timezone doesn't change with the system timezone

2022-02-10 Thread E Z
I find a way to work around. The goal is to get the valid timezone of the system periodically in my application, So I try to get the valid timezone name from the file /etc/timezone and then parse it to the necessary object I need, to avoid accessing the file too often, I add a cache for the

Re: [go-nuts] Re: DataRace with slice, should i fix it or ignore it?

2022-02-10 Thread 'Dmitry Vyukov' via golang-nuts
I've recovered it and updated the go/benign-race link. On Thu, 10 Feb 2022 at 18:35, Ian Lance Taylor wrote: > > [ + dvyukov ] > > On Thu, Feb 10, 2022 at 9:16 AM jake...@gmail.com wrote: > > > > > > On Wednesday, February 9, 2022 at 9:14:52 AM UTC-5 peterGo wrote: > >> > >> Pelen Li, > >> > >>

Re: [go-nuts] Re: DataRace with slice, should i fix it or ignore it?

2022-02-10 Thread Ian Lance Taylor
[ + dvyukov ] On Thu, Feb 10, 2022 at 9:16 AM jake...@gmail.com wrote: > > > On Wednesday, February 9, 2022 at 9:14:52 AM UTC-5 peterGo wrote: >> >> Pelen Li, >> >> Always fix your data races. You should consider the results of data races as >> undefined. >> >> Dmitry Vyukov, who implemented

Re: [go-nuts] What exactly can be supplied as "packages" on the go build command line?

2022-02-10 Thread Kurtis Rader
See `go help packages` and https://go.dev/ref/spec#Packages. On Thu, Feb 10, 2022 at 9:01 AM David Karr wrote: > When I enter "go help build", the first few lines shows this: > > usage: go build [-o output] [build flags] [packages] > > Build compiles the packages named by the import paths,

Re: [go-nuts] What exactly can be supplied as "packages" on the go build command line?

2022-02-10 Thread Ian Lance Taylor
On Thu, Feb 10, 2022 at 9:01 AM David Karr wrote: > > When I enter "go help build", the first few lines shows this: > > usage: go build [-o output] [build flags] [packages] > > Build compiles the packages named by the import paths, > > The instructions say very little about what can be

[go-nuts] Re: DataRace with slice, should i fix it or ignore it?

2022-02-10 Thread jake...@gmail.com
On Wednesday, February 9, 2022 at 9:14:52 AM UTC-5 peterGo wrote: > Pelen Li, > > Always fix your data races. You should consider the results of data races > as undefined. > > Dmitry Vyukov, who implemented the Go race detector, once wrote an > interesting article with the title: "Benign data

[go-nuts] What exactly can be supplied as "packages" on the go build command line?

2022-02-10 Thread David Karr
When I enter "go help build", the first few lines shows this: usage: go build [-o output] [build flags] [packages] Build compiles the packages named by the import paths, The instructions say very little about what can be supplied as "packages". It says it can be a list of .go files, and