Perhaps you're thinking of sum types? They are often confused as enums.
Go read Algol 60, Pascal, Modula-2, C manuals to understand what enumerations are all about.
Not a comic dance between iota and manually written constants.
From the GNU C manual: "An enumeration type represents a limited set of integer values, each with a name."
Which is exactly what Go provides. Which isn't surprising as it is identical to C in that regard.
this hack
type Operation int
const (
Escalated Operation = iota
Archived
Deleted
Completed
)
has nothing to do with typedef enum {Escalated, Archived, Deleted, Completed} Operation;
Only someone that can't get type systems would ever assert they are the same.Literally "Go enums suck", https://news.ycombinator.com/item?id=39564737