Assign a new value to Golang structure field

前端 未结 2 840
醉话见心
醉话见心 2020-12-22 06:18

I have a problem with structure fields.

I\'ve created a class Point with one method Move() that increases or decreases object variable

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-22 06:43

    That's the difference between pointer receiver and value receiver

    http://golang.org/doc/faq#methods_on_values_or_pointers

提交回复
热议问题