{"repo":"abice/go-enum","free":true,"listed":false,"github":"https://github.com/abice/go-enum","clone":"git clone https://github.com/abice/go-enum.git","description":"An enum generator for go","language":"Go","stars":954,"topics":["go","golang","enum","generated"],"license":"MIT","category":"databases-storage","readme_excerpt":"go-enum An enum generator for Go that creates type-safe enumerations with useful methods from simple type declarations. Key Features - 🎯 Type-safe enums - Generate const declarations with proper typing - 🔄 String conversion - Automatic String() and Parse() methods - 📦 JSON marshaling - Built-in JSON marshal/unmarshal support - 🗄️ SQL integration - Database scan and value functions - 🧪 Custom templates - Extend with your own code generation - ✅ Multiple types - Support for int , string , and other base types - 🏷️ Flexible syntax - Simple comment-based enum declarations Table of Contents - Key Features - Requirements - Quick Start - How it works - String typed enums - Recent Features - Goal - Docker image - Installation - Adding it to your project - Command options - Syntax - Examples Requirements - Go 1.24.0 or later (recommended for new tool installation method) - Go 1.23.0 or later (minimum for legacy installation) Quick Start 1. Install go-enum as a project tool (Go 1.24+): Or for older Go versions: 2. Create a Go file with an enum declaration: 3. Generate the enum: 4. Use your generated enum: How it works go-enum will take a commented type declaration like this: and generate a file with the iota definition along various optional niceties that you may need: Fear not the fact that the MarshalText and UnmarshalText are generated rather than JSON methods... they will still be utilized by the default JSON encoding methods. If you find that the options given are not adequa","default_branch":null,"files":null,"tree":[],"storefront":"/r/abice","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/abice/go-enum/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}