5 karma · joined Jun 20, 2018 (8y ago) · 3 submissions
comment 8y ago · link · parent
Would using a sync.WaitGroup and closure be wrong? Is mutex better for shared memory?
After setting done = true, is there no guarantee that the goroutine will complete before the for loop ends?