Repository: abice/go-enum
Pull request #139 (2022-10-07 20:28:34)

Fix deprecated function use, ignored return
Hi, I saw some warnings in my IDE while browsing the code, and I thought why not submit some fix for it.

One thing I didn't fix because it broke some of the tests was `strings.Title`.

These are the tests which failed. IMO, the `cases.Title` is probably more correct than the `strings.Title`. I tested with the recommended `cases.Title(language.Und, cases.NoLower).String()`.

```
    generator_test.go:61: snapshot not equal:
        --- Previous
        +++ Current
        @@ -1739,8 +1739,8 @@
           (string) (len=22) "\tSanitizingHyphenStart",
        -  (string) (len=72) "\t// Sanitizing_underscoreFirst is a Sanitizing of type _underscoreFirst.",
        -  (string) (len=27) "\tSanitizing_underscoreFirst",
        -  (string) (len=64) "\t// Sanitizing0numberFirst is a Sanitizing of type 0numberFirst.",
        -  (string) (len=23) "\tSanitizing0numberFirst",
        -  (string) (len=60) "\t// Sanitizing123456789a is a Sanitizing of type 123456789a.",
        -  (string) (len=21) "\tSanitizing123456789a",
        +  (string) (len=72) "\t// Sanitizing_UnderscoreFirst is a Sanitizing of type _UnderscoreFirst.",
        +  (string) (len=27) "\tSanitizing_UnderscoreFirst",
        +  (string) (len=64) "\t// Sanitizing0NumberFirst is a Sanitizing of type 0NumberFirst.",
        +  (string) (len=23) "\tSanitizing0NumberFirst",
        +  (string) (len=60) "\t// Sanitizing123456789A is a Sanitizing of type 123456789A.",
        +  (string) (len=21) "\tSanitizing123456789A",
           (string) (len=61) "\t// Sanitizing123123Asdf is a Sanitizing of type 123123-Asdf.",
        @@ -1773,5 +1773,5 @@
           (string) (len=52) "\tSanitizingHyphenStart:      _SanitizingName[11:23],",
        -  (string) (len=52) "\tSanitizing_underscoreFirst: _SanitizingName[23:39],",
        -  (string) (len=52) "\tSanitizing0numberFirst:     _SanitizingName[39:51],",
        -  (string) (len=52) "\tSanitizing123456789a:       _SanitizingName[51:61],",
        +  (string) (len=52) "\tSanitizing_UnderscoreFirst: _SanitizingName[23:39],",
        +  (string) (len=52) "\tSanitizing0NumberFirst:     _SanitizingName[39:51],",
        +  (string) (len=52) "\tSanitizing123456789A:       _SanitizingName[51:61],",
           (string) (len=52) "\tSanitizing123123Asdf:       _SanitizingName[61:72],",
        @@ -1793,8 +1793,8 @@
           (string) (len=64) "\tstrings.ToLower(_SanitizingName[11:23]): SanitizingHyphenStart,",
        -  (string) (len=69) "\t_SanitizingName[23:39]:                  Sanitizing_underscoreFirst,",
        -  (string) (len=69) "\tstrings.ToLower(_SanitizingName[23:39]): Sanitizing_underscoreFirst,",
        -  (string) (len=65) "\t_SanitizingName[39:51]:                  Sanitizing0numberFirst,",
        -  (string) (len=65) "\tstrings.ToLower(_SanitizingName[39:51]): Sanitizing0numberFirst,",
        -  (string) (len=63) "\t_SanitizingName[51:61]:                  Sanitizing123456789a,",
        -  (string) (len=63) "\tstrings.ToLower(_SanitizingName[51:61]): Sanitizing123456789a,",
        +  (string) (len=69) "\t_SanitizingName[23:39]:                  Sanitizing_UnderscoreFirst,",
        +  (string) (len=69) "\tstrings.ToLower(_SanitizingName[23:39]): Sanitizing_UnderscoreFirst,",
        +  (string) (len=65) "\t_SanitizingName[39:51]:                  Sanitizing0NumberFirst,",
        +  (string) (len=65) "\tstrings.ToLower(_SanitizingName[39:51]): Sanitizing0NumberFirst,",
        +  (string) (len=63) "\t_SanitizingName[51:61]:                  Sanitizing123456789A,",
        +  (string) (len=63) "\tstrings.ToLower(_SanitizingName[51:61]): Sanitizing123456789A,",
           (string) (len=63) "\t_SanitizingName[61:72]:                  Sanitizing123123Asdf,",
```

abice: @SN9NV Thanks for the contribution!

> One thing I didn't fix because it broke some of the tests was strings.Title

The tests validate that no output was changed.  I've seen the deprecation notice for the `strings.Title` as well and didn't spend much time looking at options for it.  Looks like it might have actually been a good change to make since it adds a title to `_U` in your changes. 

In order to change that, simply run the `./update_snapshots.sh` file and it will recreate the snapshots with the current values.  Then you can upload those so that we see the diff between the two options and make a decision from there.
SN9NV: Hi, yeah that output was from `make ci` which does this, I assume, because I see it's running the tests. But I have run the script and committed the changes now so that we can see them.
abice: The build error suggests that some dependencies for older versions are changing the go.mod.

I usually fix that by running `make ci` which would modify the go.mod according to each version of go. (the older ones are the ones with problems) 
SN9NV: running `go get golang.org/x/text` seems to have fixed the problem. `go mod tidy` messed up all the tests.

Patch:
diff --git a/generator/generator.go b/generator/generator.go
index da70f76..b3463ac 100644
--- a/generator/generator.go
+++ b/generator/generator.go
@@ -15,6 +15,8 @@ import (
 
 	"github.com/Masterminds/sprig"
 	"github.com/pkg/errors"
+	"golang.org/x/text/cases"
+	"golang.org/x/text/language"
 	"golang.org/x/tools/imports"
 )
 
@@ -416,7 +418,7 @@ func (g *Generator) parseEnum(ts *ast.TypeSpec) (*Enum, error) {
 				}
 			}
 			rawName := strings.TrimSpace(value)
-			name := strings.Title(rawName)
+			name := cases.Title(language.Und, cases.NoLower).String(rawName)
 			prefixedName := name
 			if name != skipHolder {
 				prefixedName = enum.Prefix + name
@@ -490,8 +492,10 @@ func sanitizeValue(value string) string {
 
 func snakeToCamelCase(value string) string {
 	parts := strings.Split(value, "_")
+	title := cases.Title(language.Und, cases.NoLower)
+
 	for i, part := range parts {
-		parts[i] = strings.Title(part)
+		parts[i] = title.String(part)
 	}
 	value = strings.Join(parts, "")
 
diff --git a/go.mod b/go.mod
index 5f9639f..22d278a 100644
--- a/go.mod
+++ b/go.mod
@@ -11,6 +11,7 @@ require (
 	github.com/pkg/errors v0.9.1
 	github.com/stretchr/testify v1.8.1
 	github.com/urfave/cli/v2 v2.23.0
+	golang.org/x/text v0.4.0
 	golang.org/x/tools v0.2.0
 )
 
diff --git a/go.sum b/go.sum
index 0354531..1d7d506 100644
--- a/go.sum
+++ b/go.sum
@@ -119,6 +119,8 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
+golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
diff --git a/main.go b/main.go
index c1b8f74..b73cf68 100644
--- a/main.go
+++ b/main.go
@@ -2,7 +2,6 @@ package main
 
 import (
 	"fmt"
-	"io/ioutil"
 	"log"
 	"os"
 	"path/filepath"
@@ -245,7 +244,7 @@ func main() {
 					}
 
 					mode := int(0644)
-					err = ioutil.WriteFile(outFilePath, raw, os.FileMode(mode))
+					err = os.WriteFile(outFilePath, raw, os.FileMode(mode))
 					if err != nil {
 						return fmt.Errorf("failed writing to file %s: %s", color.Cyan(outFilePath), color.Red(err))
 					}


Test patch:
diff --git a/generator/.snapshots/Test118CustomPrefixExampleFile-og b/generator/.snapshots/Test118CustomPrefixExampleFile-og
index 3747410..2406e01 100644
--- a/generator/.snapshots/Test118CustomPrefixExampleFile-og
+++ b/generator/.snapshots/Test118CustomPrefixExampleFile-og
@@ -2862,12 +2862,12 @@
   (string) (len=43) "\tCustom_prefix_TestHyphen Sanitizing = iota",
   (string) (len=67) "\t// Custom_prefix_HyphenStart is a Sanitizing of type -HyphenStart.",
   (string) (len=26) "\tCustom_prefix_HyphenStart",
-  (string) (len=76) "\t// Custom_prefix__underscoreFirst is a Sanitizing of type _underscoreFirst.",
-  (string) (len=31) "\tCustom_prefix__underscoreFirst",
-  (string) (len=68) "\t// Custom_prefix_0numberFirst is a Sanitizing of type 0numberFirst.",
-  (string) (len=27) "\tCustom_prefix_0numberFirst",
-  (string) (len=64) "\t// Custom_prefix_123456789a is a Sanitizing of type 123456789a.",
-  (string) (len=25) "\tCustom_prefix_123456789a",
+  (string) (len=76) "\t// Custom_prefix__UnderscoreFirst is a Sanitizing of type _UnderscoreFirst.",
+  (string) (len=31) "\tCustom_prefix__UnderscoreFirst",
+  (string) (len=68) "\t// Custom_prefix_0NumberFirst is a Sanitizing of type 0NumberFirst.",
+  (string) (len=27) "\tCustom_prefix_0NumberFirst",
+  (string) (len=64) "\t// Custom_prefix_123456789A is a Sanitizing of type 123456789A.",
+  (string) (len=25) "\tCustom_prefix_123456789A",
   (string) (len=65) "\t// Custom_prefix_123123Asdf is a Sanitizing of type 123123-Asdf.",
   (string) (len=25) "\tCustom_prefix_123123Asdf",
   (string) (len=70) "\t// Custom_prefix_EndingHyphen is a Sanitizing of type Ending-Hyphen-.",
@@ -2881,9 +2881,9 @@
   (string) (len=43) "var _SanitizingMap = map[Sanitizing]string{",
   (string) (len=55) "\tCustom_prefix_TestHyphen:       _SanitizingName[0:11],",
   (string) (len=56) "\tCustom_prefix_HyphenStart:      _SanitizingName[11:23],",
-  (string) (len=56) "\tCustom_prefix__underscoreFirst: _SanitizingName[23:39],",
-  (string) (len=56) "\tCustom_prefix_0numberFirst:     _SanitizingName[39:51],",
-  (string) (len=56) "\tCustom_prefix_123456789a:       _SanitizingName[51:61],",
+  (string) (len=56) "\tCustom_prefix__UnderscoreFirst: _SanitizingName[23:39],",
+  (string) (len=56) "\tCustom_prefix_0NumberFirst:     _SanitizingName[39:51],",
+  (string) (len=56) "\tCustom_prefix_123456789A:       _SanitizingName[51:61],",
   (string) (len=56) "\tCustom_prefix_123123Asdf:       _SanitizingName[61:72],",
   (string) (len=56) "\tCustom_prefix_EndingHyphen:     _SanitizingName[72:86],",
   (string) (len=1) "}",
@@ -2901,12 +2901,12 @@
   (string) (len=67) "\tstrings.ToLower(_SanitizingName[0:11]):  Custom_prefix_TestHyphen,",
   (string) (len=68) "\t_SanitizingName[11:23]:                  Custom_prefix_HyphenStart,",
   (string) (len=68) "\tstrings.ToLower(_SanitizingName[11:23]): Custom_prefix_HyphenStart,",
-  (string) (len=73) "\t_SanitizingName[23:39]:                  Custom_prefix__underscoreFirst,",
-  (string) (len=73) "\tstrings.ToLower(_SanitizingName[23:39]): Custom_prefix__underscoreFirst,",
-  (string) (len=69) "\t_SanitizingName[39:51]:                  Custom_prefix_0numberFirst,",
-  (string) (len=69) "\tstrings.ToLower(_SanitizingName[39:51]): Custom_prefix_0numberFirst,",
-  (string) (len=67) "\t_SanitizingName[51:61]:                  Custom_prefix_123456789a,",
-  (string) (len=67) "\tstrings.ToLower(_SanitizingName[51:61]): Custom_prefix_123456789a,",
+  (string) (len=73) "\t_SanitizingName[23:39]:                  Custom_prefix__UnderscoreFirst,",
+  (string) (len=73) "\tstrings.ToLower(_SanitizingName[23:39]): Custom_prefix__UnderscoreFirst,",
+  (string) (len=69) "\t_SanitizingName[39:51]:                  Custom_prefix_0NumberFirst,",
+  (string) (len=69) "\tstrings.ToLower(_SanitizingName[39:51]): Custom_prefix_0NumberFirst,",
+  (string) (len=67) "\t_SanitizingName[51:61]:                  Custom_prefix_123456789A,",
+  (string) (len=67) "\tstrings.ToLower(_SanitizingName[51:61]): Custom_prefix_123456789A,",
   (string) (len=67) "\t_SanitizingName[61:72]:                  Custom_prefix_123123Asdf,",
   (string) (len=67) "\tstrings.ToLower(_SanitizingName[61:72]): Custom_prefix_123123Asdf,",
   (string) (len=69) "\t_SanitizingName[72:86]:                  Custom_prefix_EndingHyphen,",
diff --git a/generator/.snapshots/Test118ExampleFile-og b/generator/.snapshots/Test118ExampleFile-og
index a6c6ecb..2d71705 100644
--- a/generator/.snapshots/Test118ExampleFile-og
+++ b/generator/.snapshots/Test118ExampleFile-og
@@ -1757,12 +1757,12 @@
   (string) (len=39) "\tSanitizingTestHyphen Sanitizing = iota",
   (string) (len=63) "\t// SanitizingHyphenStart is a Sanitizing of type -HyphenStart.",
   (string) (len=22) "\tSanitizingHyphenStart",
-  (string) (len=72) "\t// Sanitizing_underscoreFirst is a Sanitizing of type _underscoreFirst.",
-  (string) (len=27) "\tSanitizing_underscoreFirst",
-  (string) (len=64) "\t// Sanitizing0numberFirst is a Sanitizing of type 0numberFirst.",
-  (string) (len=23) "\tSanitizing0numberFirst",
-  (string) (len=60) "\t// Sanitizing123456789a is a Sanitizing of type 123456789a.",
-  (string) (len=21) "\tSanitizing123456789a",
+  (string) (len=72) "\t// Sanitizing_UnderscoreFirst is a Sanitizing of type _UnderscoreFirst.",
+  (string) (len=27) "\tSanitizing_UnderscoreFirst",
+  (string) (len=64) "\t// Sanitizing0NumberFirst is a Sanitizing of type 0NumberFirst.",
+  (string) (len=23) "\tSanitizing0NumberFirst",
+  (string) (len=60) "\t// Sanitizing123456789A is a Sanitizing of type 123456789A.",
+  (string) (len=21) "\tSanitizing123456789A",
   (string) (len=61) "\t// Sanitizing123123Asdf is a Sanitizing of type 123123-Asdf.",
   (string) (len=21) "\tSanitizing123123Asdf",
   (string) (len=66) "\t// SanitizingEndingHyphen is a Sanitizing of type Ending-Hyphen-.",
@@ -1793,9 +1793,9 @@
   (string) (len=43) "var _SanitizingMap = map[Sanitizing]string{",
   (string) (len=51) "\tSanitizingTestHyphen:       _SanitizingName[0:11],",
   (string) (len=52) "\tSanitizingHyphenStart:      _SanitizingName[11:23],",
-  (string) (len=52) "\tSanitizing_underscoreFirst: _SanitizingName[23:39],",
-  (string) (len=52) "\tSanitizing0numberFirst:     _SanitizingName[39:51],",
-  (string) (len=52) "\tSanitizing123456789a:       _SanitizingName[51:61],",
+  (string) (len=52) "\tSanitizing_UnderscoreFirst: _SanitizingName[23:39],",
+  (string) (len=52) "\tSanitizing0NumberFirst:     _SanitizingName[39:51],",
+  (string) (len=52) "\tSanitizing123456789A:       _SanitizingName[51:61],",
   (string) (len=52) "\tSanitizing123123Asdf:       _SanitizingName[61:72],",
   (string) (len=52) "\tSanitizingEndingHyphen:     _SanitizingName[72:86],",
   (string) (len=1) "}",
@@ -1813,12 +1813,12 @@
   (string) (len=63) "\tstrings.ToLower(_SanitizingName[0:11]):  SanitizingTestHyphen,",
   (string) (len=64) "\t_SanitizingName[11:23]:                  SanitizingHyphenStart,",
   (string) (len=64) "\tstrings.ToLower(_SanitizingName[11:23]): SanitizingHyphenStart,",
-  (string) (len=69) "\t_SanitizingName[23:39]:                  Sanitizing_underscoreFirst,",
-  (string) (len=69) "\tstrings.ToLower(_SanitizingName[23:39]): Sanitizing_underscoreFirst,",
-  (string) (len=65) "\t_SanitizingName[39:51]:                  Sanitizing0numberFirst,",
-  (string) (len=65) "\tstrings.ToLower(_SanitizingName[39:51]): Sanitizing0numberFirst,",
-  (string) (len=63) "\t_SanitizingName[51:61]:                  Sanitizing123456789a,",
-  (string) (len=63) "\tstrings.ToLower(_SanitizingName[51:61]): Sanitizing123456789a,",
+  (string) (len=69) "\t_SanitizingName[23:39]:                  Sanitizing_UnderscoreFirst,",
+  (string) (len=69) "\tstrings.ToLower(_SanitizingName[23:39]): Sanitizing_UnderscoreFirst,",
+  (string) (len=65) "\t_SanitizingName[39:51]:                  Sanitizing0NumberFirst,",
+  (string) (len=65) "\tstrings.ToLower(_SanitizingName[39:51]): Sanitizing0NumberFirst,",
+  (string) (len=63) "\t_SanitizingName[51:61]:                  Sanitizing123456789A,",
+  (string) (len=63) "\tstrings.ToLower(_SanitizingName[51:61]): Sanitizing123456789A,",
   (string) (len=63) "\t_SanitizingName[61:72]:                  Sanitizing123123Asdf,",
   (string) (len=63) "\tstrings.ToLower(_SanitizingName[61:72]): Sanitizing123123Asdf,",
   (string) (len=65) "\t_SanitizingName[72:86]:                  SanitizingEndingHyphen,",
diff --git a/generator/.snapshots/Test118ExampleFileMoreOptions-og b/generator/.snapshots/Test118ExampleFileMoreOptions-og
index c0973f7..cea3613 100644
--- a/generator/.snapshots/Test118ExampleFileMoreOptions-og
+++ b/generator/.snapshots/Test118ExampleFileMoreOptions-og
@@ -1897,12 +1897,12 @@
   (string) (len=39) "\tSanitizingTestHyphen Sanitizing = iota",
   (string) (len=63) "\t// SanitizingHyphenStart is a Sanitizing of type -HyphenStart.",
   (string) (len=22) "\tSanitizingHyphenStart",
-  (string) (len=72) "\t// Sanitizing_underscoreFirst is a Sanitizing of type _underscoreFirst.",
-  (string) (len=27) "\tSanitizing_underscoreFirst",
-  (string) (len=64) "\t// Sanitizing0numberFirst is a Sanitizing of type 0numberFirst.",
-  (string) (len=23) "\tSanitizing0numberFirst",
-  (string) (len=60) "\t// Sanitizing123456789a is a Sanitizing of type 123456789a.",
-  (string) (len=21) "\tSanitizing123456789a",
+  (string) (len=72) "\t// Sanitizing_UnderscoreFirst is a Sanitizing of type _UnderscoreFirst.",
+  (string) (len=27) "\tSanitizing_UnderscoreFirst",
+  (string) (len=64) "\t// Sanitizing0NumberFirst is a Sanitizing of type 0NumberFirst.",
+  (string) (len=23) "\tSanitizing0NumberFirst",
+  (string) (len=60) "\t// Sanitizing123456789A is a Sanitizing of type 123456789A.",
+  (string) (len=21) "\tSanitizing123456789A",
   (string) (len=61) "\t// Sanitizing123123Asdf is a Sanitizing of type 123123-Asdf.",
   (string) (len=21) "\tSanitizing123123Asdf",
   (string) (len=66) "\t// SanitizingEndingHyphen is a Sanitizing of type Ending-Hyphen-.",
@@ -1933,9 +1933,9 @@
   (string) (len=43) "var _SanitizingMap = map[Sanitizing]string{",
   (string) (len=51) "\tSanitizingTestHyphen:       _SanitizingName[0:11],",
   (string) (len=52) "\tSanitizingHyphenStart:      _SanitizingName[11:23],",
-  (string) (len=52) "\tSanitizing_underscoreFirst: _SanitizingName[23:39],",
-  (string) (len=52) "\tSanitizing0numberFirst:     _SanitizingName[39:51],",
-  (string) (len=52) "\tSanitizing123456789a:       _SanitizingName[51:61],",
+  (string) (len=52) "\tSanitizing_UnderscoreFirst: _SanitizingName[23:39],",
+  (string) (len=52) "\tSanitizing0NumberFirst:     _SanitizingName[39:51],",
+  (string) (len=52) "\tSanitizing123456789A:       _SanitizingName[51:61],",
   (string) (len=52) "\tSanitizing123123Asdf:       _SanitizingName[61:72],",
   (string) (len=52) "\tSanitizingEndingHyphen:     _SanitizingName[72:86],",
   (string) (len=1) "}",
@@ -1953,12 +1953,12 @@
   (string) (len=63) "\tstrings.ToLower(_SanitizingName[0:11]):  SanitizingTestHyphen,",
   (string) (len=64) "\t_SanitizingName[11:23]:                  SanitizingHyphenStart,",
   (string) (len=64) "\tstrings.ToLower(_SanitizingName[11:23]): SanitizingHyphenStart,",
-  (string) (len=69) "\t_SanitizingName[23:39]:                  Sanitizing_underscoreFirst,",
-  (string) (len=69) "\tstrings.ToLower(_SanitizingName[23:39]): Sanitizing_underscoreFirst,",
-  (string) (len=65) "\t_SanitizingName[39:51]:                  Sanitizing0numberFirst,",
-  (string) (len=65) "\tstrings.ToLower(_SanitizingName[39:51]): Sanitizing0numberFirst,",
-  (string) (len=63) "\t_SanitizingName[51:61]:                  Sanitizing123456789a,",
-  (string) (len=63) "\tstrings.ToLower(_SanitizingName[51:61]): Sanitizing123456789a,",
+  (string) (len=69) "\t_SanitizingName[23:39]:                  Sanitizing_UnderscoreFirst,",
+  (string) (len=69) "\tstrings.ToLower(_SanitizingName[23:39]): Sanitizing_UnderscoreFirst,",
+  (string) (len=65) "\t_SanitizingName[39:51]:                  Sanitizing0NumberFirst,",
+  (string) (len=65) "\tstrings.ToLower(_SanitizingName[39:51]): Sanitizing0NumberFirst,",
+  (string) (len=63) "\t_SanitizingName[51:61]:                  Sanitizing123456789A,",
+  (string) (len=63) "\tstrings.ToLower(_SanitizingName[51:61]): Sanitizing123456789A,",
   (string) (len=63) "\t_SanitizingName[61:72]:                  Sanitizing123123Asdf,",
   (string) (len=63) "\tstrings.ToLower(_SanitizingName[61:72]): Sanitizing123123Asdf,",
   (string) (len=65) "\t_SanitizingName[72:86]:                  SanitizingEndingHyphen,",
diff --git a/generator/.snapshots/Test118NoPrefixExampleFile-og b/generator/.snapshots/Test118NoPrefixExampleFile-og
index 17990e9..cc89326 100644
--- a/generator/.snapshots/Test118NoPrefixExampleFile-og
+++ b/generator/.snapshots/Test118NoPrefixExampleFile-og
@@ -989,12 +989,12 @@
   (string) (len=29) "\tTestHyphen Sanitizing = iota",
   (string) (len=54) "\t// XHyphenStart is a Sanitizing of type -HyphenStart.",
   (string) (len=13) "\tXHyphenStart",
-  (string) (len=63) "\t// X_underscoreFirst is a Sanitizing of type _underscoreFirst.",
-  (string) (len=18) "\tX_underscoreFirst",
-  (string) (len=55) "\t// X0numberFirst is a Sanitizing of type 0numberFirst.",
-  (string) (len=14) "\tX0numberFirst",
-  (string) (len=51) "\t// X123456789a is a Sanitizing of type 123456789a.",
-  (string) (len=12) "\tX123456789a",
+  (string) (len=63) "\t// X_UnderscoreFirst is a Sanitizing of type _UnderscoreFirst.",
+  (string) (len=18) "\tX_UnderscoreFirst",
+  (string) (len=55) "\t// X0NumberFirst is a Sanitizing of type 0NumberFirst.",
+  (string) (len=14) "\tX0NumberFirst",
+  (string) (len=51) "\t// X123456789A is a Sanitizing of type 123456789A.",
+  (string) (len=12) "\tX123456789A",
   (string) (len=52) "\t// X123123Asdf is a Sanitizing of type 123123-Asdf.",
   (string) (len=12) "\tX123123Asdf",
   (string) (len=56) "\t// EndingHyphen is a Sanitizing of type Ending-Hyphen-.",
@@ -1008,9 +1008,9 @@
   (string) (len=43) "var _SanitizingMap = map[Sanitizing]string{",
   (string) (len=42) "\tTestHyphen:        _SanitizingName[0:11],",
   (string) (len=43) "\tXHyphenStart:      _SanitizingName[11:23],",
-  (string) (len=43) "\tX_underscoreFirst: _SanitizingName[23:39],",
-  (string) (len=43) "\tX0numberFirst:     _SanitizingName[39:51],",
-  (string) (len=43) "\tX123456789a:       _SanitizingName[51:61],",
+  (string) (len=43) "\tX_UnderscoreFirst: _SanitizingName[23:39],",
+  (string) (len=43) "\tX0NumberFirst:     _SanitizingName[39:51],",
+  (string) (len=43) "\tX123456789A:       _SanitizingName[51:61],",
   (string) (len=43) "\tX123123Asdf:       _SanitizingName[61:72],",
   (string) (len=43) "\tEndingHyphen:      _SanitizingName[72:86],",
   (string) (len=1) "}",
@@ -1028,12 +1028,12 @@
   (string) (len=53) "\tstrings.ToLower(_SanitizingName[0:11]):  TestHyphen,",
   (string) (len=55) "\t_SanitizingName[11:23]:                  XHyphenStart,",
   (string) (len=55) "\tstrings.ToLower(_SanitizingName[11:23]): XHyphenStart,",
-  (string) (len=60) "\t_SanitizingName[23:39]:                  X_underscoreFirst,",
-  (string) (len=60) "\tstrings.ToLower(_SanitizingName[23:39]): X_underscoreFirst,",
-  (string) (len=56) "\t_SanitizingName[39:51]:                  X0numberFirst,",
-  (string) (len=56) "\tstrings.ToLower(_SanitizingName[39:51]): X0numberFirst,",
-  (string) (len=54) "\t_SanitizingName[51:61]:                  X123456789a,",
-  (string) (len=54) "\tstrings.ToLower(_SanitizingName[51:61]): X123456789a,",
+  (string) (len=60) "\t_SanitizingName[23:39]:                  X_UnderscoreFirst,",
+  (string) (len=60) "\tstrings.ToLower(_SanitizingName[23:39]): X_UnderscoreFirst,",
+  (string) (len=56) "\t_SanitizingName[39:51]:                  X0NumberFirst,",
+  (string) (len=56) "\tstrings.ToLower(_SanitizingName[39:51]): X0NumberFirst,",
+  (string) (len=54) "\t_SanitizingName[51:61]:                  X123456789A,",
+  (string) (len=54) "\tstrings.ToLower(_SanitizingName[51:61]): X123456789A,",
   (string) (len=54) "\t_SanitizingName[61:72]:                  X123123Asdf,",
   (string) (len=54) "\tstrings.ToLower(_SanitizingName[61:72]): X123123Asdf,",
   (string) (len=55) "\t_SanitizingName[72:86]:                  EndingHyphen,",
diff --git a/generator/.snapshots/Test118NoPrefixExampleFileWithSnakeToCamel-og b/generator/.snapshots/Test118NoPrefixExampleFileWithSnakeToCamel-og
index d4b375f..e7101c3 100644
--- a/generator/.snapshots/Test118NoPrefixExampleFileWithSnakeToCamel-og
+++ b/generator/.snapshots/Test118NoPrefixExampleFileWithSnakeToCamel-og
@@ -989,12 +989,12 @@
   (string) (len=29) "\tTestHyphen Sanitizing = iota",
   (string) (len=54) "\t// XHyphenStart is a Sanitizing of type -HyphenStart.",
   (string) (len=13) "\tXHyphenStart",
-  (string) (len=62) "\t// XUnderscoreFirst is a Sanitizing of type _underscoreFirst.",
+  (string) (len=62) "\t// XUnderscoreFirst is a Sanitizing of type _UnderscoreFirst.",
   (string) (len=17) "\tXUnderscoreFirst",
-  (string) (len=55) "\t// X0numberFirst is a Sanitizing of type 0numberFirst.",
-  (string) (len=14) "\tX0numberFirst",
-  (string) (len=51) "\t// X123456789a is a Sanitizing of type 123456789a.",
-  (string) (len=12) "\tX123456789a",
+  (string) (len=55) "\t// X0NumberFirst is a Sanitizing of type 0NumberFirst.",
+  (string) (len=14) "\tX0NumberFirst",
+  (string) (len=51) "\t// X123456789A is a Sanitizing of type 123456789A.",
+  (string) (len=12) "\tX123456789A",
   (string) (len=52) "\t// X123123Asdf is a Sanitizing of type 123123-Asdf.",
   (string) (len=12) "\tX123123Asdf",
   (string) (len=56) "\t// EndingHyphen is a Sanitizing of type Ending-Hyphen-.",
@@ -1009,8 +1009,8 @@
   (string) (len=41) "\tTestHyphen:       _SanitizingName[0:11],",
   (string) (len=42) "\tXHyphenStart:     _SanitizingName[11:23],",
   (string) (len=42) "\tXUnderscoreFirst: _SanitizingName[23:39],",
-  (string) (len=42) "\tX0numberFirst:    _SanitizingName[39:51],",
-  (string) (len=42) "\tX123456789a:      _SanitizingName[51:61],",
+  (string) (len=42) "\tX0NumberFirst:    _SanitizingName[39:51],",
+  (string) (len=42) "\tX123456789A:      _SanitizingName[51:61],",
   (string) (len=42) "\tX123123Asdf:      _SanitizingName[61:72],",
   (string) (len=42) "\tEndingHyphen:     _SanitizingName[72:86],",
   (string) (len=1) "}",
@@ -1030,10 +1030,10 @@
   (string) (len=55) "\tstrings.ToLower(_SanitizingName[11:23]): XHyphenStart,",
   (string) (len=59) "\t_SanitizingName[23:39]:                  XUnderscoreFirst,",
   (string) (len=59) "\tstrings.ToLower(_SanitizingName[23:39]): XUnderscoreFirst,",
-  (string) (len=56) "\t_SanitizingName[39:51]:                  X0numberFirst,",
-  (string) (len=56) "\tstrings.ToLower(_SanitizingName[39:51]): X0numberFirst,",
-  (string) (len=54) "\t_SanitizingName[51:61]:                  X123456789a,",
-  (string) (len=54) "\tstrings.ToLower(_SanitizingName[51:61]): X123456789a,",
+  (string) (len=56) "\t_SanitizingName[39:51]:                  X0NumberFirst,",
+  (string) (len=56) "\tstrings.ToLower(_SanitizingName[39:51]): X0NumberFirst,",
+  (string) (len=54) "\t_SanitizingName[51:61]:                  X123456789A,",
+  (string) (len=54) "\tstrings.ToLower(_SanitizingName[51:61]): X123456789A,",
   (string) (len=54) "\t_SanitizingName[61:72]:                  X123123Asdf,",
   (string) (len=54) "\tstrings.ToLower(_SanitizingName[61:72]): X123123Asdf,",
   (string) (len=55) "\t_SanitizingName[72:86]:                  EndingHyphen,",
diff --git a/generator/.snapshots/TestCustomPrefixExampleFile b/generator/.snapshots/TestCustomPrefixExampleFile
index 3747410..2406e01 100644
--- a/generator/.snapshots/TestCustomPrefixExampleFile
+++ b/generator/.snapshots/TestCustomPrefixExampleFile
@@ -2862,12 +2862,12 @@
   (string) (len=43) "\tCustom_prefix_TestHyphen Sanitizing = iota",
   (string) (len=67) "\t// Custom_prefix_HyphenStart is a Sanitizing of type -HyphenStart.",
   (string) (len=26) "\tCustom_prefix_HyphenStart",
-  (string) (len=76) "\t// Custom_prefix__underscoreFirst is a Sanitizing of type _underscoreFirst.",
-  (string) (len=31) "\tCustom_prefix__underscoreFirst",
-  (string) (len=68) "\t// Custom_prefix_0numberFirst is a Sanitizing of type 0numberFirst.",
-  (string) (len=27) "\tCustom_prefix_0numberFirst",
-  (string) (len=64) "\t// Custom_prefix_123456789a is a Sanitizing of type 123456789a.",
-  (string) (len=25) "\tCustom_prefix_123456789a",
+  (string) (len=76) "\t// Custom_prefix__UnderscoreFirst is a Sanitizing of type _UnderscoreFirst.",
+  (string) (len=31) "\tCustom_prefix__UnderscoreFirst",
+  (string) (len=68) "\t// Custom_prefix_0NumberFirst is a Sanitizing of type 0NumberFirst.",
+  (string) (len=27) "\tCustom_prefix_0NumberFirst",
+  (string) (len=64) "\t// Custom_prefix_123456789A is a Sanitizing of type 123456789A.",
+  (string) (len=25) "\tCustom_prefix_123456789A",
   (string) (len=65) "\t// Custom_prefix_123123Asdf is a Sanitizing of type 123123-Asdf.",
   (string) (len=25) "\tCustom_prefix_123123Asdf",
   (string) (len=70) "\t// Custom_prefix_EndingHyphen is a Sanitizing of type Ending-Hyphen-.",
@@ -2881,9 +2881,9 @@
   (string) (len=43) "var _SanitizingMap = map[Sanitizing]string{",
   (string) (len=55) "\tCustom_prefix_TestHyphen:       _SanitizingName[0:11],",
   (string) (len=56) "\tCustom_prefix_HyphenStart:      _SanitizingName[11:23],",
-  (string) (len=56) "\tCustom_prefix__underscoreFirst: _SanitizingName[23:39],",
-  (string) (len=56) "\tCustom_prefix_0numberFirst:     _SanitizingName[39:51],",
-  (string) (len=56) "\tCustom_prefix_123456789a:       _SanitizingName[51:61],",
+  (string) (len=56) "\tCustom_prefix__UnderscoreFirst: _SanitizingName[23:39],",
+  (string) (len=56) "\tCustom_prefix_0NumberFirst:     _SanitizingName[39:51],",
+  (string) (len=56) "\tCustom_prefix_123456789A:       _SanitizingName[51:61],",
   (string) (len=56) "\tCustom_prefix_123123Asdf:       _SanitizingName[61:72],",
   (string) (len=56) "\tCustom_prefix_EndingHyphen:     _SanitizingName[72:86],",
   (string) (len=1) "}",
@@ -2901,12 +2901,12 @@
   (string) (len=67) "\tstrings.ToLower(_SanitizingName[0:11]):  Custom_prefix_TestHyphen,",
   (string) (len=68) "\t_SanitizingName[11:23]:                  Custom_prefix_HyphenStart,",
   (string) (len=68) "\tstrings.ToLower(_SanitizingName[11:23]): Custom_prefix_HyphenStart,",
-  (string) (len=73) "\t_SanitizingName[23:39]:                  Custom_prefix__underscoreFirst,",
-  (string) (len=73) "\tstrings.ToLower(_SanitizingName[23:39]): Custom_prefix__underscoreFirst,",
-  (string) (len=69) "\t_SanitizingName[39:51]:                  Custom_prefix_0numberFirst,",
-  (string) (len=69) "\tstrings.ToLower(_SanitizingName[39:51]): Custom_prefix_0numberFirst,",
-  (string) (len=67) "\t_SanitizingName[51:61]:                  Custom_prefix_123456789a,",
-  (string) (len=67) "\tstrings.ToLower(_SanitizingName[51:61]): Custom_prefix_123456789a,",
+  (string) (len=73) "\t_SanitizingName[23:39]:                  Custom_prefix__UnderscoreFirst,",
+  (string) (len=73) "\tstrings.ToLower(_SanitizingName[23:39]): Custom_prefix__UnderscoreFirst,",
+  (string) (len=69) "\t_SanitizingName[39:51]:                  Custom_prefix_0NumberFirst,",
+  (string) (len=69) "\tstrings.ToLower(_SanitizingName[39:51]): Custom_prefix_0NumberFirst,",
+  (string) (len=67) "\t_SanitizingName[51:61]:                  Custom_prefix_123456789A,",
+  (string) (len=67) "\tstrings.ToLower(_SanitizingName[51:61]): Custom_prefix_123456789A,",
   (string) (len=67) "\t_SanitizingName[61:72]:                  Custom_prefix_123123Asdf,",
   (string) (len=67) "\tstrings.ToLower(_SanitizingName[61:72]): Custom_prefix_123123Asdf,",
   (string) (len=69) "\t_SanitizingName[72:86]:                  Custom_prefix_EndingHyphen,",
diff --git a/generator/.snapshots/TestExampleFile b/generator/.snapshots/TestExampleFile
index a6c6ecb..2d71705 100644
--- a/generator/.snapshots/TestExampleFile
+++ b/generator/.snapshots/TestExampleFile
@@ -1757,12 +1757,12 @@
   (string) (len=39) "\tSanitizingTestHyphen Sanitizing = iota",
   (string) (len=63) "\t// SanitizingHyphenStart is a Sanitizing of type -HyphenStart.",
   (string) (len=22) "\tSanitizingHyphenStart",
-  (string) (len=72) "\t// Sanitizing_underscoreFirst is a Sanitizing of type _underscoreFirst.",
-  (string) (len=27) "\tSanitizing_underscoreFirst",
-  (string) (len=64) "\t// Sanitizing0numberFirst is a Sanitizing of type 0numberFirst.",
-  (string) (len=23) "\tSanitizing0numberFirst",
-  (string) (len=60) "\t// Sanitizing123456789a is a Sanitizing of type 123456789a.",
-  (string) (len=21) "\tSanitizing123456789a",
+  (string) (len=72) "\t// Sanitizing_UnderscoreFirst is a Sanitizing of type _UnderscoreFirst.",
+  (string) (len=27) "\tSanitizing_UnderscoreFirst",
+  (string) (len=64) "\t// Sanitizing0NumberFirst is a Sanitizing of type 0NumberFirst.",
+  (string) (len=23) "\tSanitizing0NumberFirst",
+  (string) (len=60) "\t// Sanitizing123456789A is a Sanitizing of type 123456789A.",
+  (string) (len=21) "\tSanitizing123456789A",
   (string) (len=61) "\t// Sanitizing123123Asdf is a Sanitizing of type 123123-Asdf.",
   (string) (len=21) "\tSanitizing123123Asdf",
   (string) (len=66) "\t// SanitizingEndingHyphen is a Sanitizing of type Ending-Hyphen-.",
@@ -1793,9 +1793,9 @@
   (string) (len=43) "var _SanitizingMap = map[Sanitizing]string{",
   (string) (len=51) "\tSanitizingTestHyphen:       _SanitizingName[0:11],",
   (string) (len=52) "\tSanitizingHyphenStart:      _SanitizingName[11:23],",
-  (string) (len=52) "\tSanitizing_underscoreFirst: _SanitizingName[23:39],",
-  (string) (len=52) "\tSanitizing0numberFirst:     _SanitizingName[39:51],",
-  (string) (len=52) "\tSanitizing123456789a:       _SanitizingName[51:61],",
+  (string) (len=52) "\tSanitizing_UnderscoreFirst: _SanitizingName[23:39],",
+  (string) (len=52) "\tSanitizing0NumberFirst:     _SanitizingName[39:51],",
+  (string) (len=52) "\tSanitizing123456789A:       _SanitizingName[51:61],",
   (string) (len=52) "\tSanitizing123123Asdf:       _SanitizingName[61:72],",
   (string) (len=52) "\tSanitizingEndingHyphen:     _SanitizingName[72:86],",
   (string) (len=1) "}",
@@ -1813,12 +1813,12 @@
   (string) (len=63) "\tstrings.ToLower(_SanitizingName[0:11]):  SanitizingTestHyphen,",
   (string) (len=64) "\t_SanitizingName[11:23]:                  SanitizingHyphenStart,",
   (string) (len=64) "\tstrings.ToLower(_SanitizingName[11:23]): SanitizingHyphenStart,",
-  (string) (len=69) "\t_SanitizingName[23:39]:                  Sanitizing_underscoreFirst,",
-  (string) (len=69) "\tstrings.ToLower(_SanitizingName[23:39]): Sanitizing_underscoreFirst,",
-  (string) (len=65) "\t_SanitizingName[39:51]:                  Sanitizing0numberFirst,",
-  (string) (len=65) "\tstrings.ToLower(_SanitizingName[39:51]): Sanitizing0numberFirst,",
-  (string) (len=63) "\t_SanitizingName[51:61]:                  Sanitizing123456789a,",
-  (string) (len=63) "\tstrings.ToLower(_SanitizingName[51:61]): Sanitizing123456789a,",
+  (string) (len=69) "\t_SanitizingName[23:39]:                  Sanitizing_UnderscoreFirst,",
+  (string) (len=69) "\tstrings.ToLower(_SanitizingName[23:39]): Sanitizing_UnderscoreFirst,",
+  (string) (len=65) "\t_SanitizingName[39:51]:                  Sanitizing0NumberFirst,",
+  (string) (len=65) "\tstrings.ToLower(_SanitizingName[39:51]): Sanitizing0NumberFirst,",
+  (string) (len=63) "\t_SanitizingName[51:61]:                  Sanitizing123456789A,",
+  (string) (len=63) "\tstrings.ToLower(_SanitizingName[51:61]): Sanitizing123456789A,",
   (string) (len=63) "\t_SanitizingName[61:72]:                  Sanitizing123123Asdf,",
   (string) (len=63) "\tstrings.ToLower(_SanitizingName[61:72]): Sanitizing123123Asdf,",
   (string) (len=65) "\t_SanitizingName[72:86]:                  SanitizingEndingHyphen,",
diff --git a/generator/.snapshots/TestExampleFileMoreOptions b/generator/.snapshots/TestExampleFileMoreOptions
index c0973f7..cea3613 100644
--- a/generator/.snapshots/TestExampleFileMoreOptions
+++ b/generator/.snapshots/TestExampleFileMoreOptions
@@ -1897,12 +1897,12 @@
   (string) (len=39) "\tSanitizingTestHyphen Sanitizing = iota",
   (string) (len=63) "\t// SanitizingHyphenStart is a Sanitizing of type -HyphenStart.",
   (string) (len=22) "\tSanitizingHyphenStart",
-  (string) (len=72) "\t// Sanitizing_underscoreFirst is a Sanitizing of type _underscoreFirst.",
-  (string) (len=27) "\tSanitizing_underscoreFirst",
-  (string) (len=64) "\t// Sanitizing0numberFirst is a Sanitizing of type 0numberFirst.",
-  (string) (len=23) "\tSanitizing0numberFirst",
-  (string) (len=60) "\t// Sanitizing123456789a is a Sanitizing of type 123456789a.",
-  (string) (len=21) "\tSanitizing123456789a",
+  (string) (len=72) "\t// Sanitizing_UnderscoreFirst is a Sanitizing of type _UnderscoreFirst.",
+  (string) (len=27) "\tSanitizing_UnderscoreFirst",
+  (string) (len=64) "\t// Sanitizing0NumberFirst is a Sanitizing of type 0NumberFirst.",
+  (string) (len=23) "\tSanitizing0NumberFirst",
+  (string) (len=60) "\t// Sanitizing123456789A is a Sanitizing of type 123456789A.",
+  (string) (len=21) "\tSanitizing123456789A",
   (string) (len=61) "\t// Sanitizing123123Asdf is a Sanitizing of type 123123-Asdf.",
   (string) (len=21) "\tSanitizing123123Asdf",
   (string) (len=66) "\t// SanitizingEndingHyphen is a Sanitizing of type Ending-Hyphen-.",
@@ -1933,9 +1933,9 @@
   (string) (len=43) "var _SanitizingMap = map[Sanitizing]string{",
   (string) (len=51) "\tSanitizingTestHyphen:       _SanitizingName[0:11],",
   (string) (len=52) "\tSanitizingHyphenStart:      _SanitizingName[11:23],",
-  (string) (len=52) "\tSanitizing_underscoreFirst: _SanitizingName[23:39],",
-  (string) (len=52) "\tSanitizing0numberFirst:     _SanitizingName[39:51],",
-  (string) (len=52) "\tSanitizing123456789a:       _SanitizingName[51:61],",
+  (string) (len=52) "\tSanitizing_UnderscoreFirst: _SanitizingName[23:39],",
+  (string) (len=52) "\tSanitizing0NumberFirst:     _SanitizingName[39:51],",
+  (string) (len=52) "\tSanitizing123456789A:       _SanitizingName[51:61],",
   (string) (len=52) "\tSanitizing123123Asdf:       _SanitizingName[61:72],",
   (string) (len=52) "\tSanitizingEndingHyphen:     _SanitizingName[72:86],",
   (string) (len=1) "}",
@@ -1953,12 +1953,12 @@
   (string) (len=63) "\tstrings.ToLower(_SanitizingName[0:11]):  SanitizingTestHyphen,",
   (string) (len=64) "\t_SanitizingName[11:23]:                  SanitizingHyphenStart,",
   (string) (len=64) "\tstrings.ToLower(_SanitizingName[11:23]): SanitizingHyphenStart,",
-  (string) (len=69) "\t_SanitizingName[23:39]:                  Sanitizing_underscoreFirst,",
-  (string) (len=69) "\tstrings.ToLower(_SanitizingName[23:39]): Sanitizing_underscoreFirst,",
-  (string) (len=65) "\t_SanitizingName[39:51]:                  Sanitizing0numberFirst,",
-  (string) (len=65) "\tstrings.ToLower(_SanitizingName[39:51]): Sanitizing0numberFirst,",
-  (string) (len=63) "\t_SanitizingName[51:61]:                  Sanitizing123456789a,",
-  (string) (len=63) "\tstrings.ToLower(_SanitizingName[51:61]): Sanitizing123456789a,",
+  (string) (len=69) "\t_SanitizingName[23:39]:                  Sanitizing_UnderscoreFirst,",
+  (string) (len=69) "\tstrings.ToLower(_SanitizingName[23:39]): Sanitizing_UnderscoreFirst,",
+  (string) (len=65) "\t_SanitizingName[39:51]:                  Sanitizing0NumberFirst,",
+  (string) (len=65) "\tstrings.ToLower(_SanitizingName[39:51]): Sanitizing0NumberFirst,",
+  (string) (len=63) "\t_SanitizingName[51:61]:                  Sanitizing123456789A,",
+  (string) (len=63) "\tstrings.ToLower(_SanitizingName[51:61]): Sanitizing123456789A,",
   (string) (len=63) "\t_SanitizingName[61:72]:                  Sanitizing123123Asdf,",
   (string) (len=63) "\tstrings.ToLower(_SanitizingName[61:72]): Sanitizing123123Asdf,",
   (string) (len=65) "\t_SanitizingName[72:86]:                  SanitizingEndingHyphen,",
diff --git a/generator/.snapshots/TestNoPrefixExampleFile b/generator/.snapshots/TestNoPrefixExampleFile
index 17990e9..cc89326 100644
--- a/generator/.snapshots/TestNoPrefixExampleFile
+++ b/generator/.snapshots/TestNoPrefixExampleFile
@@ -989,12 +989,12 @@
   (string) (len=29) "\tTestHyphen Sanitizing = iota",
   (string) (len=54) "\t// XHyphenStart is a Sanitizing of type -HyphenStart.",
   (string) (len=13) "\tXHyphenStart",
-  (string) (len=63) "\t// X_underscoreFirst is a Sanitizing of type _underscoreFirst.",
-  (string) (len=18) "\tX_underscoreFirst",
-  (string) (len=55) "\t// X0numberFirst is a Sanitizing of type 0numberFirst.",
-  (string) (len=14) "\tX0numberFirst",
-  (string) (len=51) "\t// X123456789a is a Sanitizing of type 123456789a.",
-  (string) (len=12) "\tX123456789a",
+  (string) (len=63) "\t// X_UnderscoreFirst is a Sanitizing of type _UnderscoreFirst.",
+  (string) (len=18) "\tX_UnderscoreFirst",
+  (string) (len=55) "\t// X0NumberFirst is a Sanitizing of type 0NumberFirst.",
+  (string) (len=14) "\tX0NumberFirst",
+  (string) (len=51) "\t// X123456789A is a Sanitizing of type 123456789A.",
+  (string) (len=12) "\tX123456789A",
   (string) (len=52) "\t// X123123Asdf is a Sanitizing of type 123123-Asdf.",
   (string) (len=12) "\tX123123Asdf",
   (string) (len=56) "\t// EndingHyphen is a Sanitizing of type Ending-Hyphen-.",
@@ -1008,9 +1008,9 @@
   (string) (len=43) "var _SanitizingMap = map[Sanitizing]string{",
   (string) (len=42) "\tTestHyphen:        _SanitizingName[0:11],",
   (string) (len=43) "\tXHyphenStart:      _SanitizingName[11:23],",
-  (string) (len=43) "\tX_underscoreFirst: _SanitizingName[23:39],",
-  (string) (len=43) "\tX0numberFirst:     _SanitizingName[39:51],",
-  (string) (len=43) "\tX123456789a:       _SanitizingName[51:61],",
+  (string) (len=43) "\tX_UnderscoreFirst: _SanitizingName[23:39],",
+  (string) (len=43) "\tX0NumberFirst:     _SanitizingName[39:51],",
+  (string) (len=43) "\tX123456789A:       _SanitizingName[51:61],",
   (string) (len=43) "\tX123123Asdf:       _SanitizingName[61:72],",
   (string) (len=43) "\tEndingHyphen:      _SanitizingName[72:86],",
   (string) (len=1) "}",
@@ -1028,12 +1028,12 @@
   (string) (len=53) "\tstrings.ToLower(_SanitizingName[0:11]):  TestHyphen,",
   (string) (len=55) "\t_SanitizingName[11:23]:                  XHyphenStart,",
   (string) (len=55) "\tstrings.ToLower(_SanitizingName[11:23]): XHyphenStart,",
-  (string) (len=60) "\t_SanitizingName[23:39]:                  X_underscoreFirst,",
-  (string) (len=60) "\tstrings.ToLower(_SanitizingName[23:39]): X_underscoreFirst,",
-  (string) (len=56) "\t_SanitizingName[39:51]:                  X0numberFirst,",
-  (string) (len=56) "\tstrings.ToLower(_SanitizingName[39:51]): X0numberFirst,",
-  (string) (len=54) "\t_SanitizingName[51:61]:                  X123456789a,",
-  (string) (len=54) "\tstrings.ToLower(_SanitizingName[51:61]): X123456789a,",
+  (string) (len=60) "\t_SanitizingName[23:39]:                  X_UnderscoreFirst,",
+  (string) (len=60) "\tstrings.ToLower(_SanitizingName[23:39]): X_UnderscoreFirst,",
+  (string) (len=56) "\t_SanitizingName[39:51]:                  X0NumberFirst,",
+  (string) (len=56) "\tstrings.ToLower(_SanitizingName[39:51]): X0NumberFirst,",
+  (string) (len=54) "\t_SanitizingName[51:61]:                  X123456789A,",
+  (string) (len=54) "\tstrings.ToLower(_SanitizingName[51:61]): X123456789A,",
   (string) (len=54) "\t_SanitizingName[61:72]:                  X123123Asdf,",
   (string) (len=54) "\tstrings.ToLower(_SanitizingName[61:72]): X123123Asdf,",
   (string) (len=55) "\t_SanitizingName[72:86]:                  EndingHyphen,",
diff --git a/generator/.snapshots/TestNoPrefixExampleFileWithSnakeToCamel b/generator/.snapshots/TestNoPrefixExampleFileWithSnakeToCamel
index d4b375f..e7101c3 100644
--- a/generator/.snapshots/TestNoPrefixExampleFileWithSnakeToCamel
+++ b/generator/.snapshots/TestNoPrefixExampleFileWithSnakeToCamel
@@ -989,12 +989,12 @@
   (string) (len=29) "\tTestHyphen Sanitizing = iota",
   (string) (len=54) "\t// XHyphenStart is a Sanitizing of type -HyphenStart.",
   (string) (len=13) "\tXHyphenStart",
-  (string) (len=62) "\t// XUnderscoreFirst is a Sanitizing of type _underscoreFirst.",
+  (string) (len=62) "\t// XUnderscoreFirst is a Sanitizing of type _UnderscoreFirst.",
   (string) (len=17) "\tXUnderscoreFirst",
-  (string) (len=55) "\t// X0numberFirst is a Sanitizing of type 0numberFirst.",
-  (string) (len=14) "\tX0numberFirst",
-  (string) (len=51) "\t// X123456789a is a Sanitizing of type 123456789a.",
-  (string) (len=12) "\tX123456789a",
+  (string) (len=55) "\t// X0NumberFirst is a Sanitizing of type 0NumberFirst.",
+  (string) (len=14) "\tX0NumberFirst",
+  (string) (len=51) "\t// X123456789A is a Sanitizing of type 123456789A.",
+  (string) (len=12) "\tX123456789A",
   (string) (len=52) "\t// X123123Asdf is a Sanitizing of type 123123-Asdf.",
   (string) (len=12) "\tX123123Asdf",
   (string) (len=56) "\t// EndingHyphen is a Sanitizing of type Ending-Hyphen-.",
@@ -1009,8 +1009,8 @@
   (string) (len=41) "\tTestHyphen:       _SanitizingName[0:11],",
   (string) (len=42) "\tXHyphenStart:     _SanitizingName[11:23],",
   (string) (len=42) "\tXUnderscoreFirst: _SanitizingName[23:39],",
-  (string) (len=42) "\tX0numberFirst:    _SanitizingName[39:51],",
-  (string) (len=42) "\tX123456789a:      _SanitizingName[51:61],",
+  (string) (len=42) "\tX0NumberFirst:    _SanitizingName[39:51],",
+  (string) (len=42) "\tX123456789A:      _SanitizingName[51:61],",
   (string) (len=42) "\tX123123Asdf:      _SanitizingName[61:72],",
   (string) (len=42) "\tEndingHyphen:     _SanitizingName[72:86],",
   (string) (len=1) "}",
@@ -1030,10 +1030,10 @@
   (string) (len=55) "\tstrings.ToLower(_SanitizingName[11:23]): XHyphenStart,",
   (string) (len=59) "\t_SanitizingName[23:39]:                  XUnderscoreFirst,",
   (string) (len=59) "\tstrings.ToLower(_SanitizingName[23:39]): XUnderscoreFirst,",
-  (string) (len=56) "\t_SanitizingName[39:51]:                  X0numberFirst,",
-  (string) (len=56) "\tstrings.ToLower(_SanitizingName[39:51]): X0numberFirst,",
-  (string) (len=54) "\t_SanitizingName[51:61]:                  X123456789a,",
-  (string) (len=54) "\tstrings.ToLower(_SanitizingName[51:61]): X123456789a,",
+  (string) (len=56) "\t_SanitizingName[39:51]:                  X0NumberFirst,",
+  (string) (len=56) "\tstrings.ToLower(_SanitizingName[39:51]): X0NumberFirst,",
+  (string) (len=54) "\t_SanitizingName[51:61]:                  X123456789A,",
+  (string) (len=54) "\tstrings.ToLower(_SanitizingName[51:61]): X123456789A,",
   (string) (len=54) "\t_SanitizingName[61:72]:                  X123123Asdf,",
   (string) (len=54) "\tstrings.ToLower(_SanitizingName[61:72]): X123123Asdf,",
   (string) (len=55) "\t_SanitizingName[72:86]:                  EndingHyphen,",
diff --git a/generator/.snapshots/TestReplacePrefixExampleFile b/generator/.snapshots/TestReplacePrefixExampleFile
index 852cf96..e6f3a13 100644
--- a/generator/.snapshots/TestReplacePrefixExampleFile
+++ b/generator/.snapshots/TestReplacePrefixExampleFile
@@ -989,12 +989,12 @@
   (string) (len=38) "\tMyPrefix_TestHyphen Sanitizing = iota",
   (string) (len=62) "\t// MyPrefix_HyphenStart is a Sanitizing of type -HyphenStart.",
   (string) (len=21) "\tMyPrefix_HyphenStart",
-  (string) (len=71) "\t// MyPrefix__underscoreFirst is a Sanitizing of type _underscoreFirst.",
-  (string) (len=26) "\tMyPrefix__underscoreFirst",
-  (string) (len=63) "\t// MyPrefix_0numberFirst is a Sanitizing of type 0numberFirst.",
-  (string) (len=22) "\tMyPrefix_0numberFirst",
-  (string) (len=59) "\t// MyPrefix_123456789a is a Sanitizing of type 123456789a.",
-  (string) (len=20) "\tMyPrefix_123456789a",
+  (string) (len=71) "\t// MyPrefix__UnderscoreFirst is a Sanitizing of type _UnderscoreFirst.",
+  (string) (len=26) "\tMyPrefix__UnderscoreFirst",
+  (string) (len=63) "\t// MyPrefix_0NumberFirst is a Sanitizing of type 0NumberFirst.",
+  (string) (len=22) "\tMyPrefix_0NumberFirst",
+  (string) (len=59) "\t// MyPrefix_123456789A is a Sanitizing of type 123456789A.",
+  (string) (len=20) "\tMyPrefix_123456789A",
   (string) (len=60) "\t// MyPrefix_123123Asdf is a Sanitizing of type 123123-Asdf.",
   (string) (len=20) "\tMyPrefix_123123Asdf",
   (string) (len=65) "\t// MyPrefix_EndingHyphen is a Sanitizing of type Ending-Hyphen-.",
@@ -1008,9 +1008,9 @@
   (string) (len=43) "var _SanitizingMap = map[Sanitizing]string{",
   (string) (len=50) "\tMyPrefix_TestHyphen:       _SanitizingName[0:11],",
   (string) (len=51) "\tMyPrefix_HyphenStart:      _SanitizingName[11:23],",
-  (string) (len=51) "\tMyPrefix__underscoreFirst: _SanitizingName[23:39],",
-  (string) (len=51) "\tMyPrefix_0numberFirst:     _SanitizingName[39:51],",
-  (string) (len=51) "\tMyPrefix_123456789a:       _SanitizingName[51:61],",
+  (string) (len=51) "\tMyPrefix__UnderscoreFirst: _SanitizingName[23:39],",
+  (string) (len=51) "\tMyPrefix_0NumberFirst:     _SanitizingName[39:51],",
+  (string) (len=51) "\tMyPrefix_123456789A:       _SanitizingName[51:61],",
   (string) (len=51) "\tMyPrefix_123123Asdf:       _SanitizingName[61:72],",
   (string) (len=51) "\tMyPrefix_EndingHyphen:     _SanitizingName[72:86],",
   (string) (len=1) "}",
@@ -1028,12 +1028,12 @@
   (string) (len=62) "\tstrings.ToLower(_SanitizingName[0:11]):  MyPrefix_TestHyphen,",
   (string) (len=63) "\t_SanitizingName[11:23]:                  MyPrefix_HyphenStart,",
   (string) (len=63) "\tstrings.ToLower(_SanitizingName[11:23]): MyPrefix_HyphenStart,",
-  (string) (len=68) "\t_SanitizingName[23:39]:                  MyPrefix__underscoreFirst,",
-  (string) (len=68) "\tstrings.ToLower(_SanitizingName[23:39]): MyPrefix__underscoreFirst,",
-  (string) (len=64) "\t_SanitizingName[39:51]:                  MyPrefix_0numberFirst,",
-  (string) (len=64) "\tstrings.ToLower(_SanitizingName[39:51]): MyPrefix_0numberFirst,",
-  (string) (len=62) "\t_SanitizingName[51:61]:                  MyPrefix_123456789a,",
-  (string) (len=62) "\tstrings.ToLower(_SanitizingName[51:61]): MyPrefix_123456789a,",
+  (string) (len=68) "\t_SanitizingName[23:39]:                  MyPrefix__UnderscoreFirst,",
+  (string) (len=68) "\tstrings.ToLower(_SanitizingName[23:39]): MyPrefix__UnderscoreFirst,",
+  (string) (len=64) "\t_SanitizingName[39:51]:                  MyPrefix_0NumberFirst,",
+  (string) (len=64) "\tstrings.ToLower(_SanitizingName[39:51]): MyPrefix_0NumberFirst,",
+  (string) (len=62) "\t_SanitizingName[51:61]:                  MyPrefix_123456789A,",
+  (string) (len=62) "\tstrings.ToLower(_SanitizingName[51:61]): MyPrefix_123456789A,",
   (string) (len=62) "\t_SanitizingName[61:72]:                  MyPrefix_123123Asdf,",
   (string) (len=62) "\tstrings.ToLower(_SanitizingName[61:72]): MyPrefix_123123Asdf,",
   (string) (len=64) "\t_SanitizingName[72:86]:                  MyPrefix_EndingHyphen,",
diff --git a/generator/generator_1.18_test.go b/generator/generator_1.18_test.go
index 9292b95..8c8a649 100644
--- a/generator/generator_1.18_test.go
+++ b/generator/generator_1.18_test.go
@@ -310,7 +310,7 @@ func Test118Aliasing(t *testing.T) {
 	`
 	g := NewGenerator().
 		WithoutSnakeToCamel()
-	ParseAliases([]string{"CDEF:C"})
+	_ = ParseAliases([]string{"CDEF:C"})
 	f, err := parser.ParseFile(g.fileSet, "TestRequiredErrors", input, parser.ParseComments)
 	assert.Nil(t, err, "Error parsing no struct input")
 
diff --git a/generator/generator_test.go b/generator/generator_test.go
index e37a321..f82f190 100644
--- a/generator/generator_test.go
+++ b/generator/generator_test.go
@@ -307,7 +307,7 @@ func TestAliasing(t *testing.T) {
 	`
 	g := NewGenerator().
 		WithoutSnakeToCamel()
-	ParseAliases([]string{"CDEF:C"})
+	_ = ParseAliases([]string{"CDEF:C"})
 	f, err := parser.ParseFile(g.fileSet, "TestRequiredErrors", input, parser.ParseComments)
 	assert.Nil(t, err, "Error parsing no struct input")