From a1605fba51e73eff38d24fb7101be3cee358d634 Mon Sep 17 00:00:00 2001 From: mieubrisse Date: Fri, 4 Feb 2022 13:25:17 -0300 Subject: [PATCH] Add usage for module-aware generation --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index b9fafb8..2ec7e45 100644 --- a/README.md +++ b/README.md @@ -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