Is it possible to get the name Enum without creating func (TheEnum) String() string in Golang?
const ( MERCURY = 1 VENUS = iota EARTH MARS JUPITER SATURN URANUS NEPTUNE PLUTO )
or is there a way to define constants "on the fly"? I found two ways struct and string , but both methods force us to repeat each label 1 more time (or copy-paste and quote or use the editor macro)
enums go
Kokizzu
source share