Registry / utility / dmarkham-enumer

dmarkham-enumer

JSON →
library1.6.3gogounverified

A tool to generate Go code that adds useful methods to Go enums (constants with a specific type).

go get github.com/dmarkham/enumer
INSTALL
IMPORT
SIG · DMARKHAM-ENUMER
D
dmarkham-enumer
utilitygov1.6.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

enumer
github.com/dmarkham/enumer

Generates enum methods for a Color type

package main import ( "fmt" "github.com/dmarkham/enumer" ) //go:generate enumer -type=Color -json type Color int const ( Red Color = iota Green Blue ) func main() { fmt.Println(Red.String()) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.6.3latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
dmarkham-enumer — go get dmarkham-enumer · libregistry