Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardGoescape analysisSingle-choice MCQ

In this snippet, why does passing s to fmt.Println typically cause the underlying value to escape, even though s itself is a local slice?

func dump() { s := []int{1, 2, 3} fmt.Println(s) }