Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardGoslice header aliasing pitfallsSingle-choice MCQ

After `s := make([]int, 3, 6); t := s[:2]`, you do `t = append(t, 99)`. What happens to `s[2]` and why?

s := make([]int, 3, 6) s[2] = 7 t := s[:2] t = append(t, 99) fmt.Println(s[2])