Version 1.9 introduced the sync.Map https://golang.org/pkg/sync/#Map Would using a sync.WaitGroup and closure be wrong? Is mutex better for shared memory?
Why does this race? After setting done = true, is there no guarantee that the goroutine will complete before the for loop ends?
Version 1.9 introduced the sync.Map https://golang.org/pkg/sync/#Map Would using a sync.WaitGroup and closure be wrong? Is mutex better for shared memory?
Why does this race? After setting done = true, is there no guarantee that the goroutine will complete before the for loop ends?