At https://golang.org/ref/spec#Constant_declarations where it talks
about omitting the expression list, it says
Such an empty list is equivalent to the textual substitution of the
first preceding non-empty expression list and its type if any.
In the declaration
const (
One = iota
Two = 2
Three
)
I would interpret the phrase "first preceding" in the spec as meaning "=
iota", when it is really means "= 2". Both "= iota" and "= 2" are
preceding non-empty expressions, and "= iota" is the first. I think the
phrase should be changed to "most recent preceding" or "last preceding"
(I prefer "most recent").
...Marvin
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.