未验证 提交 d81fdab7 编写于 作者: A astaxie 提交者: GitHub

Merge pull request #989 from frankyxhl/patch-2

Fix a small zh typo
......@@ -238,7 +238,7 @@ func main() {
也许细心的读者会问这样的问题,PaintItBlack里面调用SetColor的时候是不是应该写成`(&bl[i]).SetColor(BLACK)`,因为SetColor的receiver是*Box,而不是Box。
你又说对,这两种方式都可以,因为Go知道receiver是指针,他自动帮你转了。
你又说对,这两种方式都可以,因为Go知道receiver是指针,他自动帮你转了。
也就是说:
>如果一个method的receiver是*T,你可以在一个T类型的实例变量V上面调用这个method,而不需要&V去调用这个method
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册