From ac4e3125056826be2ca8af13b00b51fe997d30d5 Mon Sep 17 00:00:00 2001 From: Sarlor Date: Thu, 26 Apr 2018 01:40:04 +0800 Subject: [PATCH] Update 10.5.md (#458) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 去掉代码行末的分号 --- eBook/10.5.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eBook/10.5.md b/eBook/10.5.md index 26ab16b..c74446c 100644 --- a/eBook/10.5.md +++ b/eBook/10.5.md @@ -110,14 +110,14 @@ type A struct {a int} type B struct {a, b int} type C struct {A; B} -var c C; +var c C ``` 规则 2:使用 `c.a` 是错误的,到底是 `c.A.a` 还是 `c.B.a` 呢?会导致编译器错误:**ambiguous DOT reference c.a disambiguate with either c.A.a or c.B.a**。 ```go type D struct {B; b float32} -var d D; +var d D ``` 规则1:使用 `d.b` 是没问题的:它是 float32,而不是 `B` 的 `b`。如果想要内层的 `b` 可以通过 `d.B.b` 得到。