My object is not updated even if I use the pointer to a type to update it

后端 未结 3 1559
我在风中等你
我在风中等你 2020-11-29 11:38

I store some Individual objects in a slice. Before appending it to the slice I print the name of the Individual object.

After I have stored

3条回答
  •  萌比男神i
    2020-11-29 12:13

    See https://play.golang.org/p/eg8oYDV6Xx p1 and p2 are already addresses, you don't need to their address (address of address), just print p1 and p2 - they'll be the same as you can see.

提交回复
热议问题