enumcheck
Allows to mark Go enum types as exhaustive. (by loov)
enumeration
Enumerations for Go - a really useful yet easy-to-use code generator (by rickb777)
enumcheck | enumeration | |
---|---|---|
3 | 3 | |
32 | 12 | |
- | - | |
0.0 | 5.6 | |
about 2 years ago | 11 days ago | |
Go | Go | |
MIT License | BSD 3-clause "New" or "Revised" License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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.
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.
enumcheck
Posts with mentions or reviews of enumcheck.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-02-16.
-
Rusty enums in Go
You can write a linter that checks for exhaustiveness. I wrote a proof-of-concept some time ago: https://github.com/loov/enumcheck... so probably doesn't work with generics.
-
Why are enums not a thing in Go?
closed set of enumerated values/types; use a linter, e.g. enumcheck
-
Hacking sum types with Go generics
I wrote a proof-of-concept for checking enum exhaustiveness https://github.com/loov/enumcheck.
enumeration
Posts with mentions or reviews of enumeration.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-05-22.
-
Why are enums not a thing in Go?
I regularly use a tool I maintain (that I derived from others' work) that generates the enums I need for me. (https://github.com/rickb777/enumeration)
-
How to type a string literal union (or a string enum) in Go?
My tool (https://github.com/rickb777/enumeration) is derived from the excellent work of others; I added serialisation and DB storage features. See the readme.
-
Safer Enums in Go
In Go, I've been quite satisfied with the integer-based constants first blogged about, I think, by Russ Cox. A simple enum code generator was offered; I've developed this idea further in my own tool (https://github.com/rickb777/enumeration).
What are some alternatives?
When comparing enumcheck and enumeration you can also consider the following projects:
exhaustive - Check exhaustiveness of switch statements of enum-like constants in Go source code.
go - The Go programming language
go-sumtype - A simple utility for running exhaustiveness checks on Go "sum types."
enumer - A Go tool to auto generate methods for your enums
revive - 🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
texpack - Texture packer with image, font and sdf support.
grype - A vulnerability scanner for container images and filesystems