// enumizer:target
type Color string
const (
Red Color = "red"
Green Color = "green"
Blue Color = "blue"
)
If base type of enum is string like Color, String() should be as follows:
func String(c Color) string {
switch c {
case Red, Green, Blue:
return string(c)
default:
return "unknown Color"
}
}
If the value and String() result are different, users will be confused.