mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 00:43:26 +08:00
翻译11.12部分内容
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
在第 10.6.3 节及例子 methodset1.go 中我们看到,作用于变量上的方法实际上是不区分变量到底是指针还是值的。当碰到接口类型值时,这会变得有点复杂,原因是接口变量中存储的具体值是不可寻址的,幸运的是,如果使用不当编译器会给出错误。考虑下面的程序:
|
||||
|
||||
示例 11.5 methodset2.go:
|
||||
示例 11.5 [methodset2.go](examples/chapter_11/methodset2.go):
|
||||
|
||||
```go
|
||||
package main
|
||||
|
Reference in New Issue
Block a user