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

Given this code, what does the Go memory model say about whether the goroutine is guaranteed to observe a == 1?

var a int c := make(chan struct{}) go func() { a = 1 c <- struct{}{} }() <-c print(a)