Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardGoGo memory modelSingle-choice MCQ

Consider this program with no synchronization between the two goroutines. According to the Go memory model, which statement about its behavior is correct?

var a int var done bool func setup() { a = 42 done = true } func main() { go setup() for !done { } print(a) }