[go-nuts] Re: Race detector question

2022-09-17 Thread stephen.t....@gmail.com
On Thursday, September 15, 2022 at 4:01:59 AM UTC+1 ren...@ix.netcom.com wrote: > Is there any way to perform “lazy loads” in Go? > Not that I can see but it would be very useful in the case of a GUI running in a separate goroutine to the one creating/updating data being displayed by the GU

[go-nuts] Re: Race detector question

2022-09-14 Thread robert engels
Ignore the first part - got bit by the ol' append() and that slices are a struct not a pointer - so they can’t be atomically updated (need to use atomic.Value I guess) - so it was simpler to wrap in Lock/Unlock when accessing the slice and ensure a new slice was used during assignment. The foll