From f3fec002f112ee5ad01f73cd4a08a8e705629112 Mon Sep 17 00:00:00 2001 From: Alvaro Lopez Espinosa Date: Tue, 6 Feb 2018 12:17:13 +0000 Subject: [PATCH] Change the name of the generated file --- README.md | 2 +- stringer.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1ce1548..0b08693 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ were added (i.e. `enumer -type=MyType -json -transform=snake`). Possible transform values are `snake` and `kebab` for transformation to snake_case and kebab-case accordingly. The default value for `transform` flag is `noop` which means no transformation will be performed. -If a prefix is provided via the `trimprefix` flag that will be trimmed from the start of each name (before +If a prefix is provided via the `trimprefix` flag, it will be trimmed from the start of each name (before it is transformed). If a name doesn't have the prefix it will be passed unchanged. ## Inspiring projects diff --git a/stringer.go b/stringer.go index b257965..8120f39 100644 --- a/stringer.go +++ b/stringer.go @@ -165,7 +165,7 @@ func main() { // Write to file. outputName := *output if outputName == "" { - baseName := fmt.Sprintf("%s_string.go", types[0]) + baseName := fmt.Sprintf("%s_enumer.go", types[0]) outputName = filepath.Join(dir, strings.ToLower(baseName)) } err := ioutil.WriteFile(outputName, src, 0644)