3 ms·
This is cool and something about Go that I hadn’t researched much yet. It does make me wonder, however, why not just include some higher level structure for thi
by ViViDboarder 6y ago
This is cool and something about Go that I hadn’t researched much yet. It does make me wonder, however, why not just include some higher level structure for this? Or even some method built into the compiler? It feels odd to have to install a dependency like `stringer` just to build. Do I had it to my go.mod file? Also, the comment structure, while flexible, could be greatly simplified for common cases like this if there was, for instance, an enum type.
I really do enjoy Go, but there are several examples of things like enums that are left out because there is some way of doing it otherwise to only the theoretical advantage of “elegance” at the cost of developer productivity.