Dereferencing a map index in Golang

前端 未结 3 889
渐次进展
渐次进展 2020-12-03 11:27

I\'m learning Go currently and I made this simple and crude inventory program just to tinker with structs and methods to understand how they work. In the driver file I try t

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 12:19

    A map entry cannot be addressed (as its address might change during map growth/shrink), so you cannot call pointer receiver methods on them.

    Detail here: https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/4_pabWnsMp0

提交回复
热议问题