This ‘Season’ type can be used like any other type in go, but with limited allowed values.
package main
type Season int
const (
Spring Season = iota
Summer
Autumn
Winter
)
func main() {
var season Season
season = Summer
}
Code language: JavaScript (javascript)