func g(l []int) {
l[2] = 123
ll := l
ll[2] = 456
if ll != nil {
}
}
l := []int{1, 2, 3}
l1 := l
g(l)
fmt.Println(l)
fmt.Println(l1)
func g1(m map[int]int) {
m[2] = 123
mm := m
mm[2] = 456
if mm != nil {
}
}
标签:传递,nil,int,ll,456,切片,mm,123
来源: https://www.cnblogs.com/rsapaper/p/16184261.html