mirror of
https://github.com/golang/go
synced 2024-11-21 23:44:39 -07:00
fix description of iota to reflect reality.
SVN=117108
This commit is contained in:
parent
f53db3eaa9
commit
c1aba41194
@ -1246,9 +1246,11 @@ the others have.
|
|||||||
The constant generator 'iota'
|
The constant generator 'iota'
|
||||||
----
|
----
|
||||||
|
|
||||||
Within a declaration, each appearance of the keyword 'iota' represents a successive
|
Within a declaration, the keyword 'iota' represents successive
|
||||||
element of an integer sequence. It is reset to zero whenever the keyword 'const', 'type'
|
elements of an integer sequence.
|
||||||
or 'var' introduces a new declaration. For instance, 'iota' can be used to construct
|
It is reset to zero whenever the keyword 'const'
|
||||||
|
introduces a new declaration and increments as each identifier
|
||||||
|
is declared. For instance, 'iota' can be used to construct
|
||||||
a set of related constants:
|
a set of related constants:
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -1266,6 +1268,7 @@ a set of related constants:
|
|||||||
const x = iota; // sets x to 0
|
const x = iota; // sets x to 0
|
||||||
const y = iota; // sets y to 0
|
const y = iota; // sets y to 0
|
||||||
|
|
||||||
|
TODO: should iota work in var, type, func decls too?
|
||||||
|
|
||||||
Statements
|
Statements
|
||||||
----
|
----
|
||||||
|
Loading…
Reference in New Issue
Block a user