Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardGothe race detectorSingle-choice MCQ

The data race detector reports a race in this program even though the goroutine only ever reads done and main only ever writes it. What is the precise reason the detector flags it?

var done bool func main() { go func() { for !done { } }() done = true // ... wait somehow }