Add prefix after transform

This commit is contained in:
Luca Osti 2019-03-22 11:36:16 +01:00
parent ea11b04142
commit 5511caae23
2 changed files with 3 additions and 4 deletions

View File

@ -158,8 +158,7 @@ The default value for `transform` flag is `noop` which means no transformation w
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.
If a prefix is provided via the `addprefix` flag, it will be added to the start of each name (before
it is transformed and after trimming).
If a prefix is provided via the `addprefix` flag, it will be added to the start of each name (after trimming and after transforming).
## Inspiring projects

View File

@ -330,10 +330,10 @@ func (g *Generator) generate(typeName string, includeJSON, includeYAML, includeS
g.trimValueNames(values, trimPrefix)
g.prefixValueNames(values, addPrefix)
g.transformValueNames(values, transformMethod)
g.prefixValueNames(values, addPrefix)
runs := splitIntoRuns(values)
// The decision of which pattern to use depends on the number of
// runs in the numbers. If there's only one, it's easy. For more than