📌  相关文章
📜  golang iota enum - Go 编程语言 - Go 编程语言代码示例

📅  最后修改于: 2022-03-11 14:45:02.228000             🧑  作者: Mango

代码示例1
type Direction int

const (
    North Direction = iota
    East
    South
    West
)

func (d Direction) String() string {
    return [...]string{"North", "East", "South", "West"}[d]
}