Change the name of the generated file

This commit is contained in:
Alvaro Lopez Espinosa 2018-02-06 12:17:13 +00:00
parent 644919b7e9
commit f3fec002f1
2 changed files with 2 additions and 2 deletions

View File

@ -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. 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. 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. it is transformed). If a name doesn't have the prefix it will be passed unchanged.
## Inspiring projects ## Inspiring projects

View File

@ -165,7 +165,7 @@ func main() {
// Write to file. // Write to file.
outputName := *output outputName := *output
if outputName == "" { 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)) outputName = filepath.Join(dir, strings.ToLower(baseName))
} }
err := ioutil.WriteFile(outputName, src, 0644) err := ioutil.WriteFile(outputName, src, 0644)