3 ms·
Personally, by now I would already be happy with Pascal like enumerations, instead of the stupid iota/const hack, yes it is an hack. type StatusCod
by pjmlp 1y ago
Personally, by now I would already be happy with Pascal like enumerations, instead of the stupid iota/const hack, yes it is an hack.
type
StatusCodes = (Success, Ongoing, Done)
or if you prefer, while bikeshedding what keyword to use,
type
StatusCodes enumeration (Success, Ongoing, Done)
Naturally, it is so much better to write
type StatusCodes int
const (
Success StatusCodes = iota
Ongoing
Done
)