shockerli / shockerli.github.io

My personal blog
https://shockerli.net
0 stars 0 forks source link

post/golang-faq-cannot-take-the-address/ #4

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Go 挖坑指南: “cannot take the address of XXX” and “cannot call pointer method on XXX” - 格物

对于类型为 T 的操作数 x,地址操作符 &x 将生成一个类型为 *T 的指针指向 x。操作数必须可寻址,即,变量、间接指针、切片索引操作,或可寻址结构体的字段选择器,或可寻址数组的数组索�

https://shockerli.net/post/golang-faq-cannot-take-the-address/

wiloon commented 2 years ago

mark, 转载到了 https://wangyue.dev