Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardGothe Go memory model and happens-beforeSingle-choice MCQ

Consider this program run with GOMAXPROCS > 1. According to the Go memory model, what behavior is permitted?

package main import "fmt" var a int var done bool func setup() { a = 1 done = true } func main() { go setup() for !done { } fmt.Println(a) }