Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
khazhoux
2y ago
0 comments
Save
Share
The article is about enums, which are lacking in Go.
0 comments
3 comments · 1 top-level
top
newest
oldest
randomdata
2y ago
· 2 in thread
No, Go definitely has enums. It is sum types (that some people have recently started calling enums) that Go lacks.
grumpyprole
2y ago
Go does not model enums as separate types (like e.g. Pascal), they are essentially just integers like C.
randomdata
2y ago
No, Go enums are definitely separate types. Sure, technically there is also an integer (or some other base representation) hidden in there somewhere, but that's what an enumeration is. Without that you don't have an enum.
1 more reply
j
/
k
navigate · click thread line to collapse