Add support for case changing
The main reason behind this PR is I often have my enums defined as upper snake case like this: MY_ENUM. This means when I run the generator the constant generated is EnumTypeMYENUM, instead of EnumTypeMyEnum as expected.
Note: the lowercase name transformation is applied before the CamelCase transformation.
Example
Declaration:
// ENUM(MY_ENUM)
type EnumType int
Before this PR:
Generated Constant
const (
// EnumTypeMYENUM is a EnumType of type MY_ENUM.
EnumTypeMYENUM = iota
)
After this PR:
Generated Constant
const (
// EnumTypeMyEnum is a EnumType of type MY_ENUM.
EnumTypeMyEnum = iota
)
Thanks for submitting a PR!
-
please make this an opt in option rather than opt out. Changing default behavior is not something I want to do to current users.
-
if you want to make sure that your PR passes in the tests, there is a make target of
cithat you can use to run equivalent tests locally.
Merged in an opt-in version of this functionality. Closing this PR