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

A slice's runtime header is {ptr, len, cap}. Given the code below, what is printed?

package main import "fmt" func main() { s := []int{1, 2, 3} t := s[:2] t = append(t, 99) s[0] = 100 fmt.Println(s, t) }