Update 10.5.md (#458)

去掉代码行末的分号
This commit is contained in:
Sarlor
2018-04-26 01:40:04 +08:00
committed by 无闻
parent 7e91eaaa63
commit ac4e312505

View File

@@ -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` 得到。