golang pointer in range doesn't work
问题 Why the result is A:&{[{[{1}]}]}A:&{[{[{2}]}]}A:&{[{[{2}]}]} not: A:&{[{[{1}]}]}A:&{[{[{2}]}]}A:&{[{[{3}]}]} we can't use pointer in range? here is the code, I set a pointer, pointed in the range loop, but it fails. package main import( "fmt" ) type A struct{ Barry []B } func (this *A)init(){ b:=&B{} b.init() this.Barry=[]B{*b} return } type B struct{ Carry []C } func (this *B)init(){ c:=&C{} c.init() this.Carry=[]C{*c} return } type C struct{ state string } func (this *C)init(){ this.state=