Go 系列教程 —— 16. 结构体

Noluye · 2018-01-22 17:52:48
emp8 := &Employee{"Sam", "Anderson", 55, 6000,}
fmt.Printf("%T",emp8)

*main.Employee

#1
更多评论
iflet
new go coder

提升字段那里,假如Person本身就包含有state字段,那么 p.state 输出的是 Address的state还是 Person的state?

#2
iflet
new go coder

试了一下,输出的是Person的state

#3