News for hackers. Stuff that matters.
Re:Down the Golang Nil Rabbit Hole by mimischi on Tuesday March 30, 2021 @02:41AM (#26631766)
Can‘t this be fixed by changing bits to be passed by value?

https://play.golang.org/p/srAyKZN2NTH

Re:Down the Golang Nil Rabbit Hole by thwarted on Tuesday March 30, 2021 @02:55AM (#26631836)
Yes, it is odd to pass the address of a local variable from the enclosing scope like this to a go routine.
Re:Down the Golang Nil Rabbit Hole by masklinn on Tuesday March 30, 2021 @03:52AM (#26632139)
Well that's true in the sense that usually you'd just close over it, which is the classic broken case of closing over a mutable binding: https://play.golang.org/p/40FRmvhifBl

I assume GGP's contrived example is to show the underlying mechanics of the issue.