enumer
enumer copied to clipboard
A Go tool to auto generate methods for your enums
`-trimprefix` accepts a [comma-separated list](https://github.com/dmarkham/enumer/blob/870b5b97632ec91dec3e31973c7b549215dc7063/stringer.go#L435) of prefixes, but the README/help doesn't mention this.
The readme does a good job of explaining the use of enumer, comprehensive enough that you might not need more, but the actual use of the package is sort of...
[kr/pretty](https://pkg.go.dev/github.com/kr/pretty) wants a type to implement [fmt.GoStringer](https://pkg.go.dev/fmt#GoStringer), so I had to wrap enumer's String, e.g. ```go func (x MyType) GoString() string { return x.String() } ``` It'd be nice if...
This is one of my two solutions to fix #40. Add a `-casesensitive` flag, which disables all generation of lower-cased values. - This required more code changes up front, and...
This is one of my two solutions to fix #40. Split `_typeNameToValueMap` into `_typeNameToValueMap` and `_typeLowerNameToValueMap`. - `_typeNameToValueMap` is checked first with a fallback to the lower-cased map. This lets...
Would it make sense to add support for enum aliases ? Example: ```go type MyType int const ( A MyType = iota B ) const ( AlsoA = A BInSpanish...
After updating our project version to 1.24 we had to bump enumer to v1.5.11 and it started failing for all our usages with `no value for constant `. After bumping...
I'm not sure if this is intentional or not, but thought I'd let you know in case it isn't.
Hello There are two useful interfaces that I often forget to implement when I am using the enumeration types on command line flags There are two common interfaces: - the...
fixing ioutil deprecations and format source code there are still two deprecations that I have no idea how to fix properly: perhaps by using github.com/iancoleman/strcase solve some of the issues...