forked from mirror/enumer
Change the name of the generated file
This commit is contained in:
parent
644919b7e9
commit
f3fec002f1
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue