Golang Const Iota
const (
C0 = iota
C1
C2
)
fmt.Println(C0, C1, C2) // "0 1 2"
knavels
const (
C0 = iota
C1
C2
)
fmt.Println(C0, C1, C2) // "0 1 2"
type Direction int
const (
North Direction = iota
East
South
West
)
func (d Direction) String() string {
return [...]string{"North", "East", "South", "West"}[d]
}