```go
type Color struct{ c uint8 }
//go:generate go-enum-encoding -type=Color
var (
UndefinedColor = Color{} // json:"-"
Red = Color{1} // json:"red"
Green = Color{2} // json:"green"
Blue = Color{3} // json:"blue"
)
```
This tool extends json tag notation to variables and generates JSON encoding/decoding boilerplate.
More Details
To generate boilerplate JSON encoding/decoding blocks.
This is very lightweight solution of <100 LOC single-file with 100% test coverage. It even generates tests for generated code as well.
I really liked this syntax, so would like to share to others. Cheers!