Better HN
topnewbestaskshowjobs
Log inSign up

gophergopher

5 karma · joined Jun 20, 2018 (8y ago) · 3 submissions

Submissions

comment 8y ago · link · parent

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?

comment 8y ago · link · parent

Why does this race?

After setting done = true, is there no guarantee that the goroutine will complete before the for loop ends?