package main
import (
"fmt"
)
func main() {
values := make([]int, 0, 100)
val := make([][]int, 2)
for i:=0; i<2; i++ {
values = values[:0]
for j:=0; j<2; j++ {
values = append(values, i+j)
}
val[i] = values
fmt.Println(values, val) //
}
fmt.Println(val)
}
https://play.golang.org/p/5x60VfDXbFw
when appending slice,val is expected to be [[0, 1], [1, 2]], but got [[1,2], [1,2]]