Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyGogoroutines basicsSingle-choice MCQ

What does this loop print, given how loop variables interact with goroutines in Go 1.21 and earlier?

// Go 1.21 or earlier for i := 0; i < 3; i++ { go func() { fmt.Print(i) }() } time.Sleep(time.Second)