Closed as not planned
Description
Go Programming Experience
Intermediate
Other Languages Experience
Python
Related Idea
- Has this idea, or one like it, been proposed before?
- Does this affect error handling?
- Is this about generics?
- Is this change backward compatible? Breaking the Go 1 compatibility guarantee is a large cost and requires a large benefit
Has this idea, or one like it, been proposed before?
Yes.
I am making this proposal since the last proposal I found was from 2017, it is better that there is a more current one, on that topic they spoke very positively about it being in go, so you already know what to do.
Does this affect error handling?
No.
Is this about generics?
No.
Proposal
add a much better way of defining enums, like:
type BetterEnum enum { FIRST = "enumsaregood" SECOND = "oldenumsarebad" }
According to me and many, it is a much more readable way than doing things with constants and types.
Language Spec Changes
No response
Informal Change
No response
Is this change backward compatible?
Yes.
There is no way to remove the old way of doing it, because they would remove the constants and that makes no sense.
Orthogonality: How does this change interact or overlap with existing features?
No response
Would this change make Go easier or harder to learn, and why?
No response
Cost Description
No response
Changes to Go ToolChain
No response
Performance Costs
No response
Prototype
(#19814)