Update 11.6.md (#469)

修改一些问题
This commit is contained in:
Sarlor
2018-05-19 05:37:22 +08:00
committed by 无闻
parent 8777fc7678
commit 7b1805eada

View File

@@ -62,7 +62,7 @@ func main() {
**讨论**
`lst` 上调用 `CountInto` 时会导致一个编译器错误,因为 `CountInto` 需要一个 `Appender`,而它的方法 `Append` 只定义在指针上。 在 `lst` 上调用 `LongEnough` 是可以的因为 'Len' 定义在值上。
`lst` 上调用 `CountInto` 时会导致一个编译器错误,因为 `CountInto` 需要一个 `Appender`,而它的方法 `Append` 只定义在指针上。 在 `lst` 上调用 `LongEnough` 是可以的因为 `Len` 定义在值上。
`plst` 上调用 `CountInto` 是可以的,因为 `CountInto` 需要一个 `Appender`,并且它的方法 `Append` 定义在指针上。 在 `plst` 上调用 `LongEnough` 也是可以的,因为指针会被自动解引用。
@@ -89,4 +89,4 @@ Go 语言规范定义了接口方法集的调用规则:
- [目录](directory.md)
- 上一节:[测试一个值是否实现了某个接口](11.5.md)
- 下一节:[第一个例子:使用 Sorter 接口排序](11.7.md)
- 下一节:[第一个例子:使用 Sorter 接口排序](11.7.md)