I haven't run the code under the race detector (hint, do this and you'll have the official answer) but I don't believe wg.Wait creates a happens before event that ensures the assignment to result will be visible to other goroutine.
-- 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.