enumer
codegena
enumer | codegena | |
---|---|---|
6 | 1 | |
373 | 0 | |
- | - | |
2.3 | 5.7 | |
3 months ago | 6 months ago | |
Go | SCSS | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
enumer
- Go Enums Still Suck
-
Go isn't the right tool for ANY job
Just use const blocks, iota and enumer and be happy.
-
Does Go not have enums in the sense that I can use them as a type?
Define your type as an alias on int and values using iota as others have said, then autogenerate the rest of the functionality from other languages with https://github.com/dmarkham/enumer
-
Safer Enums in Go
We tried out struct-based enums like this for a while and they're definitely better than the vanilla version, but they still have the problem of "how do you iterate over all the values?" and "how do you create an enum value from a string?". We chanced upon https://github.com/dmarkham/enumer a few months ago and have been very happy so far.
Use enumer in combination with what some of this article.
- What I'd like to see in Go 2.0
codegena
-
Flask app for templating and code generation
I have open sourced a tool I created where you can generate code from templates. It is a python flask-app and you can access it via https://codegena.cihan.rocks/ or GitHub link is https://github.com/cekware/codegena
What are some alternatives?
go-sumtype - A simple utility for running exhaustiveness checks on Go "sum types."
teleport-code-generators - A collection of code generators for modern JavaScript applications
go101 - An up-to-date (unofficial) knowledge base for Go programming self learning
clangir - A new (MLIR based) high-level IR for clang.
yaegi - Yaegi is Another Elegant Go Interpreter
nshipster.com - A journal of the overlooked bits in Objective-C, Swift, and Cocoa.
go-retry - Go library for retrying with configurable backoffs
CodeRL - This is the official code for the paper CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning (NeurIPS22).
yaegi-template - Use yaegi as a template engine.
CodeGenX - Code Generation using GPT-J!
go - The Go programming language
Arrow Meta - Functional companion to Kotlin's Compiler