Every constant in a constant declaration block needs to have a type unless
the iota
construct is used
const (
First byte = 1
Second = 2
)
the constant Second
does not have the same type as First
.
const (
First byte = 1
Second byte = 2
)
However, for iota
declarations, the following would work
const (
First byte = iota
Second
)