tech
enumer
tech | enumer | |
---|---|---|
1 | 6 | |
7 | 371 | |
- | - | |
6.8 | 2.3 | |
8 months ago | 3 months ago | |
Go | Go | |
MIT License | GNU General Public License v3.0 or later |
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.
tech
-
Safer Enums in Go
That code appears to be using reflection, and any checking is done at runtime?
https://github.com/qlova/tech/blob/c6379c9c32e5b7b2973bc02ba...
That's a big difference from other languages where this is all handled at compile time (ex. exhaustive switches).
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
What are some alternatives?
software - DeepValueNetwork is a peer-to-peer database network managed and hosted by its community. It contains a browser to render 2D/3D content and allow the creation of scripted applications built on top of the p2p database network and managed by its creators, without intermediary platform.
go-sumtype - A simple utility for running exhaustiveness checks on Go "sum types."
go101 - An up-to-date (unofficial) knowledge base for Go programming self learning
yaegi - Yaegi is Another Elegant Go Interpreter
go-retry - Go library for retrying with configurable backoffs
codegena - Codegeneration tool
yaegi-template - Use yaegi as a template engine.
go - The Go programming language
go-enumer - ✨ Go-Enums with Magic ✨
go-zero - A cloud-native Go microservices framework with cli tool for productivity.
sqlread - SQL Dump Parser - Query MySQL Dumps Directly without loading them into MySQL
enumeration - Enumerations for Go - a really useful yet easy-to-use code generator