Re: [go-nuts] Closing write side of os.Pipe caused different behaviors

2024-11-07 Thread Kurtis Rader
You have at least three problems. The first is a race condition in the second, goroutine, version of your program. Add a `time.Sleep(time.Second)` just before the `wpipe.Close()` and you should see the same behavior as the non-goroutine version. That provides a hint regarding the primary problem.

[go-nuts] Closing write side of os.Pipe caused different behaviors

2024-11-07 Thread huan xiong
Hi, I wonder why the two programs below have different behaviors? Both start `yes` command, close write side of the pipe (because the main process doesn't use it), and read from the read side of the pipe. The only difference is one doesn't use goroutine and another uses it. 1) The first progra

Re: [go-nuts] atomic variables?

2024-11-07 Thread scott beeker
*True* *However, it's important to note that in some cases, multiple loads might be necessary for correctness, such as in certain lock-free algorithms or when implementing specific memory ordering requirements* *citation .**W

Re: [go-nuts] atomic variables?

2024-11-07 Thread Ian Lance Taylor
On Thu, Nov 7, 2024 at 2:54 PM Roger wrote: > > True or false, it's better to avoid loading atomic variables unnecessarily? Questions like this always depend on the context. There is no answer that is always correct in all situations. That said, all else being equal, it's better to avoid loadin

[go-nuts] atomic variables?

2024-11-07 Thread Roger
Hi, True or false, it's better to avoid loading atomic variables unnecessarily? -- 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...@googlegr

[go-nuts] Re: gopls breaking imports?

2024-11-07 Thread 'Robert Findley' via golang-nuts
Hi John, I'm not able to immediately reproduce with VS Code, but if you file an issue we can investigate. We'll want the logs with the `-rpc.trace` flag passed to gopls, from a brief session reproducing the problem. Thanks, - Rob On Thursday, November 7, 2024 at 1:49:44 PM UTC-5 John Robinson

[go-nuts] gopls breaking imports?

2024-11-07 Thread John Robinson
Hi! When autocomplete tries to add a missing module for me (using BBEdit on a Mac), the result is a real mess. I’ve seen this consistently across multiple go and gopls releases (currently on 1.23.2 and 0.16.2), multiple codebases, and when adding modules from the standard library or remote sources

[go-nuts] Re: Issue with integration test coverage

2024-11-07 Thread Chittoor Murari
I am facing the same issue. I have go binary running in a docker container (built using -cover -covermode=atomic) I am doing API testing by calling HTTP / grpc endpoints to the service (and comparing the response - an independent tool is doing this using curl / grpcurl) I see that covmeta file

[go-nuts] Proxy in Google Play Integrity Library

2024-11-07 Thread Fawkes
Hi, Im trying to pass a proxy URL into the Play integrity library, but for some reason the http transport which Im passing onto the client is not working as expected. It would be helpful if anyone can guide me in this. Thanks in advance. Here is my code: ctx := context.Background() credentials,

Re: [go-nuts] Golang career

2024-11-07 Thread Michał Matczuk
Learning a new language is always a good idea as it exposes you to new concepts and ways of doing things. Go is quite unique, there are interesting and thought provoking design choices. It's not too much of an investment to grasp the basics. Maybe you can give it a shot and decide if you like it/

Re: [go-nuts] Re: encoding/json treats []byte as b64 encoded. Could it not?

2024-11-07 Thread Nikolay Dubina
I also stumbled upon this bug. I have base64 of some data in []bytes field in my struct. I do json.Marshal, then json.Unmarshal to the same struct type. And now, surprise! data automatically base64 decoded. what... any encoder in any system should have following guarantee (enforced with fuzz te

Re: [go-nuts] Golang career

2024-11-07 Thread Marcello H
When I was training people in Go, they took 5-7 days (of 8 hours) to learn the basics of Go. I was about 50 when I "touched" Go for the first time, 60 now :-) Op woensdag 6 november 2024 om 22:46:35 UTC+1 schreef Amnon: > You will probably be able to learn Go in a week. > > On Wednesday 6 Novemb