type Animal struct {
Name string
LegCount int
}
snake := Animal{Name: "snake", LegCount: 0}
worm := Animal{Name: "worm"}
Question: How can I check snake
and worm
after they've been set, to tell that:
-
snake
was explicitly set with aLegCount
of 0. - The
worm
'sLegCount
was not explicitly set (and therefore based off of its default value)?