AIGo★ 525⑂ 77 forks
dmarkham/enumer
AUTO ENUM GENERATION IN GO
enumer is a Go utility that automatically generates common methods for your enum types: String(), MarshalJSON, UnmarshalJSON and parsing from a string. Just add the comment //go:generate enumer -type=MyEnum and get ready‑to‑use code without boilerplate.
// KEY FEATURES
- Generates the String() method for convenient string representation of enum values.
- Creates MarshalJSON and UnmarshalJSON for correct JSON serialization and deserialization.
- Implements a Parse function that converts arbitrary strings to enum values with validation.
- Supports custom tags and options via the //go:generate comment, without modifying source code.
New repositories every 30 minutes
REDDYX AI scans GitHub 24/7 and ships the best AI/ML/Web3 projects to Telegram.
Join on Telegram