Slices have both length and capacity. Length is the number of elements. Capacity is the total space available:
s := make([]int, 3, 5)
fmt.Println(len(s)) // 3
fmt.Println(cap(s)) // 5
You can access elements up to the length. The capacity determines how much the slice can grow before needing a new underlying array. Think of length as "used space" and capacity as "total space".