Add usage for module-aware generation

This commit is contained in:
mieubrisse 2022-02-04 13:25:17 -03:00 committed by GitHub
parent 585d6b237e
commit a1605fba51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -193,6 +193,12 @@ name := MyTypeValue.String() // name => "my_type_value"
## How to use
For a module-aware repo with `enumer` in the `go.mod` file, generation can be called by adding the following to a `.go` source file:
```golang
//go:generate go run github.com/dmarkham/enumer -type=YOURTYPE
```
There are four boolean flags: `json`, `text`, `yaml` and `sql`. You can use any combination of them (i.e. `enumer -type=Pill -json -text`),
For enum string representation transformation the `transform` and `trimprefix` flags