On 04.12.19 22:40,
csti...@gmail.com wrote:
> Hello Golang nuts group.
>
> I've tested golang's slice and got a weird result.
>
> Anyone can explain it?
>
the variable ss in the for range loop is one and the same variable, with
a different value of AA for each iteration. it has only one address.
after the for loop is done the variable has the value of the last
iteration. you can declare a new variable within the block scope that
changes between iterations:
https://play.golang.org/p/UMsez9sX9xO
hope that helps