- iota
iota
- iota (increment by 1 on every use in every constant block of var) enumeration
examples/const-block-iota/block_iota.go
package main import ( "fmt" ) const ( a = iota b = iota c = iota ) const ( d = iota e f ) func main() { fmt.Println(a) fmt.Println(b) fmt.Println(c) fmt.Println() fmt.Println(d) fmt.Println(e) fmt.Println(f) }
0 1 2 0 1 2