In Go, no dedicated Enums exist. Instead we build enum like structures:
type Status int
const (
Unknown Status = iota // 0
Active // 1
Inactive // 2
)
This is the "default" but many other ways exist.
In Go, no dedicated Enums exist. Instead we build enum like structures:
type Status int
const (
Unknown Status = iota // 0
Active // 1
Inactive // 2
)
This is the "default" but many other ways exist.