Get the latest tech news
Go structs are copied on assignment (and other things about Go I'd missed)
Go structs are copied on assignment (and other things about Go I'd missed)
The bug I spent 2 hours of my life debugging last week was effectively this code ( play.go.dev link): This prints out[{record} {banana}] – because findThing returned a copy, we didn’t change the name in the original array. apparently you can , though that can have and I’m not sure I want to to ensure that you only use the package’s public interfaces, which seems really useful there are a lots of notes about how to use contexts, channels, goroutines, mutexes, sync.WaitGroup, etc.
Or read this on Hacker News