The code might be race free for the current Go implementation but I don't think this behaviour is documented.
https://golang.org/ref/mem doesn't mention sync.WaitGroup at all. So wg.Done() doesn't necessarily happen before wg.Wait() returns and the effect of writing to "result" could be not visible after wg.Wait(). On Saturday, 20 August 2016 07:43:52 UTC+1, Jan Mercl wrote: > > On Sat, Aug 20, 2016 at 8:29 AM Yulrizka <yulr...@gmail.com <javascript:>> > wrote: > > > He argues that this is heap race condition. > > I don't know what is a heap race condition but the code is race free. > > -- > > -j > -- 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...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.