func main() {
a1 := []int{0, 1, 2, 3}
for i, v := range a1 {
fmt.Println(i, v)
if i == 0 {
a1 = a1[2:]
}
}
fmt.Println(a1)
}
Real output:
0 0
1 1
2 2
3 3
[2 3]
I think a1 has changed when i == 0, so why does v still output the value of original a1?I know the number of iterations in range has been determined, but I'm still confused about this result