mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
Updated Iota (markdown)
parent
1c8b9997b5
commit
407ce0e6d4
2
Iota.md
2
Iota.md
@ -1,6 +1,6 @@
|
||||
# Summary
|
||||
|
||||
Go's ` iota ` identifier is used in in ` const ` declarations to simplify definitions of incrementing numbers. Because it can be used in expressions, it provides a generality beyond that of simple enumerations.
|
||||
Go's ` iota ` identifier is used in ` const ` declarations to simplify definitions of incrementing numbers. Because it can be used in expressions, it provides a generality beyond that of simple enumerations.
|
||||
|
||||
The values of iota start at zero within each const block and increment by one each time it is seen. This can be combined with the constant shorthand (leaving out everything after the constant name) to very concisely define related constants.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user