匿名字段例子代码中fmt.Println参数修改
增加逗号,使编译通过
This commit is contained in:
4
2.4.md
4
2.4.md
@@ -191,9 +191,9 @@ Go里面很简单的解决了这个问题,最外层的优先访问,也就是
|
||||
|
||||
func main() {
|
||||
Bob := Employee{Human{"Bob", 34, "777-444-XXXX"}, "Designer", "333-222"}
|
||||
fmt.Println("Bob's work phone is: " Bob.phone)
|
||||
fmt.Println("Bob's work phone is:", Bob.phone)
|
||||
//如果我们要访问Human的phone字段
|
||||
fmt.Println("Bob's personal phone is: " Bob.Human.phone)
|
||||
fmt.Println("Bob's personal phone is:", Bob.Human.phone)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user