4 ms·
The posted article mentions https://github.com/abice/go-enum https://github.com/abice/go-enum, which does the same thing, no? It even generates the consts based
by PhilippGille 2y ago
The posted article mentions https://github.com/abice/go-enum https://github.com/abice/go-enum, which does the same thing, no? It even generates the consts based on a list of values in a comment.
- frou_dh 2y agoFour candidates mentioned so far in the HN comments so far. Here's 45? https://github.com/search?q=enum+generator+language%3AGo&type=repositories&l=Go https://github.com/search?q=enum+generator+language%3AGo&typ... https://github.com/search?q=enum+generation+language%3AGo&type=repositories&l=Go https://github.com/search?q=enum+generation+language%3AGo&ty...
- barnabee 2y agoIt does indeed seem to be similar, and viable option, with the difference being that the enum values are specified in a comment. You seem enthusiastic about that design decision/feature, howeever I am not sure about it, it scares me a little. It's absolutely just a hunch and personal preference but I worry that keeping the enum value inputs in comments might not be great for new contributors and in terms of maintaining the codebase over time, so I think I prefer the approach taken by enumer.