type Animal struct {
Name string
LegCount int
}
snake := Animal{Name: "snake", LegCount: 0}
worm := Animal{Name: "worm"}
问题:我如何检查snake并worm在设置后告诉:
snake被显式设置LegCount为 0。
snake
LegCount
在worm的LegCount没有明确设置的(因此根据其默认值关闭)?
worm
小唯快跑啊
相关分类