From 7e2e8bcd629be550028ecfcdc51cc0199ca124ad Mon Sep 17 00:00:00 2001 From: Alex Bice Date: Sun, 20 Mar 2022 08:20:50 -0700 Subject: [PATCH] Change generated binary to 1.18 (#91) * Update to support go 1.18 stuff * add new tests * change release to use 1.18 * fix older versions * drop support of 1.13 * up the code coverage --- .github/workflows/build_and_test.yml | 2 +- .github/workflows/release.yml | 2 +- Makefile | 13 +- example/enum_32_bit.go | 2 +- example/enum_32_bit_enum.go | 45 +- example/enum_32_bit_test.go | 45 + example/enum_64_bit.go | 2 +- example/enum_64_bit_enum.go | 49 +- example/enum_64_bit_test.go | 45 + example/force_lower_test.go | 7 + example/user_template_test.go | 8 + .../Test118CustomPrefixExampleFile-1.18 | 282 ++ ...File => Test118CustomPrefixExampleFile-og} | 0 generator/.snapshots/Test118ExampleFile-1.18 | 166 + ...-TestExampleFile => Test118ExampleFile-og} | 0 .../Test118NoPrefixExampleFile-1.18 | 90 + ...mpleFile => Test118NoPrefixExampleFile-og} | 0 ...18NoPrefixExampleFileWithSnakeToCamel-1.18 | 90 + ...118NoPrefixExampleFileWithSnakeToCamel-og} | 0 .../.snapshots/TestCustomPrefixExampleFile | 3379 +++++++++++++++++ generator/.snapshots/TestExampleFile | 2049 ++++++++++ generator/.snapshots/TestNoPrefixExampleFile | 1130 ++++++ .../TestNoPrefixExampleFileWithSnakeToCamel | 1130 ++++++ generator/example_1.18_test.go | 22 + generator/generator_1.18_test.go | 208 + generator/generator_test.go | 15 +- go.mod | 31 +- 27 files changed, 8749 insertions(+), 63 deletions(-) create mode 100644 example/enum_32_bit_test.go create mode 100644 example/enum_64_bit_test.go create mode 100644 generator/.snapshots/Test118CustomPrefixExampleFile-1.18 rename generator/.snapshots/{generator-TestCustomPrefixExampleFile => Test118CustomPrefixExampleFile-og} (100%) create mode 100644 generator/.snapshots/Test118ExampleFile-1.18 rename generator/.snapshots/{generator-TestExampleFile => Test118ExampleFile-og} (100%) create mode 100644 generator/.snapshots/Test118NoPrefixExampleFile-1.18 rename generator/.snapshots/{generator-TestNoPrefixExampleFile => Test118NoPrefixExampleFile-og} (100%) create mode 100644 generator/.snapshots/Test118NoPrefixExampleFileWithSnakeToCamel-1.18 rename generator/.snapshots/{generator-TestNoPrefixExampleFileWithSnakeToCamel => Test118NoPrefixExampleFileWithSnakeToCamel-og} (100%) create mode 100644 generator/.snapshots/TestCustomPrefixExampleFile create mode 100644 generator/.snapshots/TestExampleFile create mode 100644 generator/.snapshots/TestNoPrefixExampleFile create mode 100644 generator/.snapshots/TestNoPrefixExampleFileWithSnakeToCamel create mode 100644 generator/example_1.18_test.go create mode 100644 generator/generator_1.18_test.go diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 6baae618..0860fc44 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -14,7 +14,7 @@ jobs: matrix: go: # Drop support of go 1.12 - - "1.13" + # Drop support of go 1.13 - "1.14" - "1.15" - "1.16" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2db14eed..942fde64 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.18 - name: Cache Go modules uses: actions/cache@v1 diff --git a/Makefile b/Makefile index ae6caf62..96cf2b4f 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ build: deps $(GO) build -v -o bin/go-enum -ldflags='-X "main.version=example" -X "main.commit=example" -X "main.date=example" -X "main.builtBy=example"' . fmt: - gofmt -l -w -s $$(find . -type f -name '*.go' -not -path "./vendor/*") + -$(GO) fmt ./... test: gen-test generate $(GO) test -v -race -coverprofile=coverage.out ./... @@ -104,3 +104,14 @@ bin/go-bindata: go.sum generate1_15: generator/assets/assets.go generator/enum.tmpl docker run -i -t -w /app -v $(shell pwd):/app --entrypoint /bin/sh golang:1.15 -c 'make clean $(GOBINDATA) && $(GO) generate ./generator && make clean' + +.PHONY: ci +ci: docker_1.14 +ci: docker_1.15 +ci: docker_1.16 +ci: docker_1.17 +ci: docker_1.18 + +docker_%: + echo "##### testing golang $* #####" + docker run -i -t -w /app -v $(shell pwd):/app --entrypoint /bin/sh golang:$* -c 'make clean && make' diff --git a/example/enum_32_bit.go b/example/enum_32_bit.go index 5ceaf412..7b86b74d 100644 --- a/example/enum_32_bit.go +++ b/example/enum_32_bit.go @@ -1,4 +1,4 @@ -//go:generate ../bin/go-enum -f=$GOFILE --ptr --marshal +//go:generate ../bin/go-enum -f=$GOFILE --names package example diff --git a/example/enum_32_bit_enum.go b/example/enum_32_bit_enum.go index 4431109c..aac57aa7 100644 --- a/example/enum_32_bit_enum.go +++ b/example/enum_32_bit_enum.go @@ -8,6 +8,7 @@ package example import ( "fmt" + "strings" ) const ( @@ -39,6 +40,28 @@ const ( const _Enum32bitName = "UnknoE2P15E2P16E2P17E2P18E2P19E2P20E2P21E2P22E2P23E2P28E2P30" +var _Enum32bitNames = []string{ + _Enum32bitName[0:5], + _Enum32bitName[5:10], + _Enum32bitName[10:15], + _Enum32bitName[15:20], + _Enum32bitName[20:25], + _Enum32bitName[25:30], + _Enum32bitName[30:35], + _Enum32bitName[35:40], + _Enum32bitName[40:45], + _Enum32bitName[45:50], + _Enum32bitName[50:55], + _Enum32bitName[55:60], +} + +// Enum32bitNames returns a list of possible string values of Enum32bit. +func Enum32bitNames() []string { + tmp := make([]string, len(_Enum32bitNames)) + copy(tmp, _Enum32bitNames) + return tmp +} + var _Enum32bitMap = map[Enum32bit]string{ Enum32bitUnkno: _Enum32bitName[0:5], Enum32bitE2P15: _Enum32bitName[5:10], @@ -82,25 +105,5 @@ func ParseEnum32bit(name string) (Enum32bit, error) { if x, ok := _Enum32bitValue[name]; ok { return x, nil } - return Enum32bit(0), fmt.Errorf("%s is not a valid Enum32bit", name) -} - -func (x Enum32bit) Ptr() *Enum32bit { - return &x -} - -// MarshalText implements the text marshaller method. -func (x Enum32bit) MarshalText() ([]byte, error) { - return []byte(x.String()), nil -} - -// UnmarshalText implements the text unmarshaller method. -func (x *Enum32bit) UnmarshalText(text []byte) error { - name := string(text) - tmp, err := ParseEnum32bit(name) - if err != nil { - return err - } - *x = tmp - return nil + return Enum32bit(0), fmt.Errorf("%s is not a valid Enum32bit, try [%s]", name, strings.Join(_Enum32bitNames, ", ")) } diff --git a/example/enum_32_bit_test.go b/example/enum_32_bit_test.go new file mode 100644 index 00000000..23bad207 --- /dev/null +++ b/example/enum_32_bit_test.go @@ -0,0 +1,45 @@ +package example + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestEnum32Bit(t *testing.T) { + + tests := map[string]struct { + input string + output Enum32bit + }{ + "E2P15": { + input: `E2P15`, + output: Enum32bitE2P15, + }, + "E2P30": { + input: `E2P30`, + output: Enum32bitE2P30, + }, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + output, err := ParseEnum32bit(tc.input) + assert.NoError(t, err) + assert.Equal(t, tc.output, output) + + assert.Equal(t, tc.input, output.String()) + }) + } + + t.Run("basics", func(t *testing.T) { + assert.Equal(t, "E2P23", Enum32bitE2P23.String()) + assert.Equal(t, "Enum32bit(99)", Enum32bit(99).String()) + _, err := ParseEnum32bit("-1") + assert.Error(t, err) + + names := Enum32bitNames() + assert.Len(t, names, 12) + }) + +} diff --git a/example/enum_64_bit.go b/example/enum_64_bit.go index a5af3250..6b8bbce4 100644 --- a/example/enum_64_bit.go +++ b/example/enum_64_bit.go @@ -1,4 +1,4 @@ -//go:generate ../bin/go-enum -f=$GOFILE --ptr --marshal +//go:generate ../bin/go-enum -f=$GOFILE --names package example diff --git a/example/enum_64_bit_enum.go b/example/enum_64_bit_enum.go index 66413fe1..c2cbc991 100644 --- a/example/enum_64_bit_enum.go +++ b/example/enum_64_bit_enum.go @@ -8,6 +8,7 @@ package example import ( "fmt" + "strings" ) const ( @@ -47,6 +48,32 @@ const ( const _Enum64bitName = "UnknoE2P15E2P16E2P17E2P18E2P19E2P20E2P21E2P22E2P23E2P28E2P30E2P31E2P32E2P33E2P63" +var _Enum64bitNames = []string{ + _Enum64bitName[0:5], + _Enum64bitName[5:10], + _Enum64bitName[10:15], + _Enum64bitName[15:20], + _Enum64bitName[20:25], + _Enum64bitName[25:30], + _Enum64bitName[30:35], + _Enum64bitName[35:40], + _Enum64bitName[40:45], + _Enum64bitName[45:50], + _Enum64bitName[50:55], + _Enum64bitName[55:60], + _Enum64bitName[60:65], + _Enum64bitName[65:70], + _Enum64bitName[70:75], + _Enum64bitName[75:80], +} + +// Enum64bitNames returns a list of possible string values of Enum64bit. +func Enum64bitNames() []string { + tmp := make([]string, len(_Enum64bitNames)) + copy(tmp, _Enum64bitNames) + return tmp +} + var _Enum64bitMap = map[Enum64bit]string{ Enum64bitUnkno: _Enum64bitName[0:5], Enum64bitE2P15: _Enum64bitName[5:10], @@ -98,25 +125,5 @@ func ParseEnum64bit(name string) (Enum64bit, error) { if x, ok := _Enum64bitValue[name]; ok { return x, nil } - return Enum64bit(0), fmt.Errorf("%s is not a valid Enum64bit", name) -} - -func (x Enum64bit) Ptr() *Enum64bit { - return &x -} - -// MarshalText implements the text marshaller method. -func (x Enum64bit) MarshalText() ([]byte, error) { - return []byte(x.String()), nil -} - -// UnmarshalText implements the text unmarshaller method. -func (x *Enum64bit) UnmarshalText(text []byte) error { - name := string(text) - tmp, err := ParseEnum64bit(name) - if err != nil { - return err - } - *x = tmp - return nil + return Enum64bit(0), fmt.Errorf("%s is not a valid Enum64bit, try [%s]", name, strings.Join(_Enum64bitNames, ", ")) } diff --git a/example/enum_64_bit_test.go b/example/enum_64_bit_test.go new file mode 100644 index 00000000..6e689be4 --- /dev/null +++ b/example/enum_64_bit_test.go @@ -0,0 +1,45 @@ +package example + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestEnum64Bit(t *testing.T) { + + tests := map[string]struct { + input string + output Enum64bit + }{ + "E2P15": { + input: `E2P15`, + output: Enum64bitE2P15, + }, + "E2P63": { + input: `E2P63`, + output: Enum64bitE2P63, + }, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + output, err := ParseEnum64bit(tc.input) + assert.NoError(t, err) + assert.Equal(t, tc.output, output) + + assert.Equal(t, tc.input, output.String()) + }) + } + + t.Run("basics", func(t *testing.T) { + assert.Equal(t, "E2P23", Enum64bitE2P23.String()) + assert.Equal(t, "Enum64bit(99)", Enum64bit(99).String()) + _, err := ParseEnum64bit("-1") + assert.Error(t, err) + + names := Enum64bitNames() + assert.Len(t, names, 16) + }) + +} diff --git a/example/force_lower_test.go b/example/force_lower_test.go index 6ec9460a..49d03bd9 100644 --- a/example/force_lower_test.go +++ b/example/force_lower_test.go @@ -31,4 +31,11 @@ func TestForceLowerString(t *testing.T) { assert.Equal(t, tc.input, output.String()) }) } + + t.Run("failures", func(t *testing.T) { + assert.Equal(t, "ForceLowerType(99)", ForceLowerType(99).String()) + _, err := ParseForceLowerType("-1") + assert.Error(t, err) + + }) } diff --git a/example/user_template_test.go b/example/user_template_test.go index c206c292..b6c0fa30 100644 --- a/example/user_template_test.go +++ b/example/user_template_test.go @@ -11,4 +11,12 @@ func TestUserTemplateColor(t *testing.T) { assert.Equal(t, true, ParseOceanColorExample()) assert.Equal(t, true, ParseOceanColorGlobbedExample()) assert.Equal(t, true, ParseOceanColorGlobbedExample2()) + + val, err := ParseOceanColor("Cerulean") + assert.NoError(t, err) + assert.Equal(t, "Cerulean", val.String()) + + assert.Equal(t, "OceanColor(99)", OceanColor(99).String()) + _, err = ParseOceanColor("-1") + assert.Error(t, err) } diff --git a/generator/.snapshots/Test118CustomPrefixExampleFile-1.18 b/generator/.snapshots/Test118CustomPrefixExampleFile-1.18 new file mode 100644 index 00000000..fa47f5ab --- /dev/null +++ b/generator/.snapshots/Test118CustomPrefixExampleFile-1.18 @@ -0,0 +1,282 @@ +([]string) (len=280) { + (string) (len=41) "// Code generated by go-enum DO NOT EDIT.", + (string) (len=13) "// Version: -", + (string) (len=14) "// Revision: -", + (string) (len=16) "// Build Date: -", + (string) (len=14) "// Built By: -", + (string) "", + (string) (len=17) "package generator", + (string) "", + (string) (len=8) "import (", + (string) (len=22) "\t\"database/sql/driver\"", + (string) (len=16) "\t\"encoding/json\"", + (string) (len=6) "\t\"fmt\"", + (string) (len=10) "\t\"strconv\"", + (string) (len=10) "\t\"strings\"", + (string) "", + (string) (len=24) "\t\"github.com/pkg/errors\"", + (string) (len=1) ")", + (string) "", + (string) (len=7) "const (", + (string) (len=56) "\t// Custom_prefix_Create is a ChangeType of type Create.", + (string) (len=39) "\tCustom_prefix_Create ChangeType = iota", + (string) (len=56) "\t// Custom_prefix_Update is a ChangeType of type Update.", + (string) (len=21) "\tCustom_prefix_Update", + (string) (len=56) "\t// Custom_prefix_Delete is a ChangeType of type Delete.", + (string) (len=21) "\tCustom_prefix_Delete", + (string) (len=1) ")", + (string) "", + (string) (len=44) "const _ChangeTypeName = \"CreateUpdateDelete\"", + (string) "", + (string) (len=43) "var _ChangeTypeMap = map[ChangeType]string{", + (string) (len=44) "\tCustom_prefix_Create: _ChangeTypeName[0:6],", + (string) (len=45) "\tCustom_prefix_Update: _ChangeTypeName[6:12],", + (string) (len=46) "\tCustom_prefix_Delete: _ChangeTypeName[12:18],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=37) "func (x ChangeType) String() string {", + (string) (len=38) "\tif str, ok := _ChangeTypeMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=40) "\treturn fmt.Sprintf(\"ChangeType(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=45) "var _ChangeTypeValue = map[string]ChangeType{", + (string) (len=63) "\t_ChangeTypeName[0:6]: Custom_prefix_Create,", + (string) (len=63) "\tstrings.ToLower(_ChangeTypeName[0:6]): Custom_prefix_Create,", + (string) (len=63) "\t_ChangeTypeName[6:12]: Custom_prefix_Update,", + (string) (len=63) "\tstrings.ToLower(_ChangeTypeName[6:12]): Custom_prefix_Update,", + (string) (len=63) "\t_ChangeTypeName[12:18]: Custom_prefix_Delete,", + (string) (len=63) "\tstrings.ToLower(_ChangeTypeName[12:18]): Custom_prefix_Delete,", + (string) (len=1) "}", + (string) "", + (string) (len=64) "// ParseChangeType attempts to convert a string to a ChangeType.", + (string) (len=55) "func ParseChangeType(name string) (ChangeType, error) {", + (string) (len=41) "\tif x, ok := _ChangeTypeValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=71) "\treturn ChangeType(0), fmt.Errorf(\"%s is not a valid ChangeType\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=39) "func (x ChangeType) Ptr() *ChangeType {", + (string) (len=10) "\treturn &x", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=51) "func (x ChangeType) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=55) "func (x *ChangeType) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=34) "\ttmp, err := ParseChangeType(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=97) "var _ChangeTypeErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=58) "func (x *ChangeType) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=20) "\t\t*x = ChangeType(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=20) "\t\t*x = ChangeType(v)", + (string) (len=13) "\tcase string:", + (string) (len=30) "\t\t*x, err = ParseChangeType(v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {", + (string) (len=34) "\t\t\t\t*x, err = ChangeType(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase []byte:", + (string) (len=38) "\t\t*x, err = ParseChangeType(string(v))", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {", + (string) (len=34) "\t\t\t\t*x, err = ChangeType(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=17) "\tcase ChangeType:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=20) "\t\t*x = ChangeType(v)", + (string) (len=18) "\tcase *ChangeType:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=20) "\t\t*x = ChangeType(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=20) "\t\t*x = ChangeType(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = ChangeType(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = ChangeType(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=20) "\t\t*x = ChangeType(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = ChangeType(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = ChangeType(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = ChangeType(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=31) "\t\t*x, err = ParseChangeType(*v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {", + (string) (len=34) "\t\t\t\t*x, err = ChangeType(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=51) "func (x ChangeType) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=44) "func (x *ChangeType) Set(val string) error {", + (string) (len=31) "\tv, err := ParseChangeType(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=40) "func (x *ChangeType) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=36) "func (x *ChangeType) Type() string {", + (string) (len=20) "\treturn \"ChangeType\"", + (string) (len=1) "}", + (string) "", + (string) (len=28) "type NullChangeType struct {", + (string) (len=22) "\tChangeType ChangeType", + (string) (len=16) "\tValid bool", + (string) (len=16) "\tSet bool", + (string) (len=1) "}", + (string) "", + (string) (len=60) "func NewNullChangeType(val interface{}) (x NullChangeType) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=62) "func (x *NullChangeType) Scan(value interface{}) (err error) {", + (string) (len=13) "\tx.Set = true", + (string) (len=18) "\tif value == nil {", + (string) (len=46) "\t\tx.ChangeType, x.Valid = ChangeType(0), false", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=31) "\terr = x.ChangeType.Scan(value)", + (string) (len=23) "\tx.Valid = (err == nil)", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=55) "func (x NullChangeType) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=46) "\t// driver.Value accepts int64 for int values.", + (string) (len=32) "\treturn int64(x.ChangeType), nil", + (string) (len=1) "}", + (string) "", + (string) (len=61) "// MarshalJSON correctly serializes a NullChangeType to JSON.", + (string) (len=55) "func (n NullChangeType) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=35) "\t\treturn json.Marshal(n.ChangeType)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=67) "// UnmarshalJSON correctly deserializes a NullChangeType from JSON.", + (string) (len=56) "func (n *NullChangeType) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=31) "type NullChangeTypeStr struct {", + (string) (len=15) "\tNullChangeType", + (string) (len=1) "}", + (string) "", + (string) (len=66) "func NewNullChangeTypeStr(val interface{}) (x NullChangeTypeStr) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=58) "func (x NullChangeTypeStr) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=34) "\treturn x.ChangeType.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=61) "// MarshalJSON correctly serializes a NullChangeType to JSON.", + (string) (len=58) "func (n NullChangeTypeStr) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=35) "\t\treturn json.Marshal(n.ChangeType)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=67) "// UnmarshalJSON correctly deserializes a NullChangeType from JSON.", + (string) (len=59) "func (n *NullChangeTypeStr) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "" +} diff --git a/generator/.snapshots/generator-TestCustomPrefixExampleFile b/generator/.snapshots/Test118CustomPrefixExampleFile-og similarity index 100% rename from generator/.snapshots/generator-TestCustomPrefixExampleFile rename to generator/.snapshots/Test118CustomPrefixExampleFile-og diff --git a/generator/.snapshots/Test118ExampleFile-1.18 b/generator/.snapshots/Test118ExampleFile-1.18 new file mode 100644 index 00000000..8974ef8c --- /dev/null +++ b/generator/.snapshots/Test118ExampleFile-1.18 @@ -0,0 +1,166 @@ +([]string) (len=164) { + (string) (len=41) "// Code generated by go-enum DO NOT EDIT.", + (string) (len=13) "// Version: -", + (string) (len=14) "// Revision: -", + (string) (len=16) "// Build Date: -", + (string) (len=14) "// Built By: -", + (string) "", + (string) (len=17) "package generator", + (string) "", + (string) (len=8) "import (", + (string) (len=22) "\t\"database/sql/driver\"", + (string) (len=6) "\t\"fmt\"", + (string) (len=10) "\t\"strings\"", + (string) "", + (string) (len=24) "\t\"github.com/pkg/errors\"", + (string) (len=1) ")", + (string) "", + (string) (len=7) "const (", + (string) (len=52) "\t// ChangeTypeCreate is a ChangeType of type Create.", + (string) (len=35) "\tChangeTypeCreate ChangeType = iota", + (string) (len=52) "\t// ChangeTypeUpdate is a ChangeType of type Update.", + (string) (len=17) "\tChangeTypeUpdate", + (string) (len=52) "\t// ChangeTypeDelete is a ChangeType of type Delete.", + (string) (len=17) "\tChangeTypeDelete", + (string) (len=1) ")", + (string) "", + (string) (len=44) "const _ChangeTypeName = \"CreateUpdateDelete\"", + (string) "", + (string) (len=32) "var _ChangeTypeNames = []string{", + (string) (len=22) "\t_ChangeTypeName[0:6],", + (string) (len=23) "\t_ChangeTypeName[6:12],", + (string) (len=24) "\t_ChangeTypeName[12:18],", + (string) (len=1) "}", + (string) "", + (string) (len=74) "// ChangeTypeNames returns a list of possible string values of ChangeType.", + (string) (len=33) "func ChangeTypeNames() []string {", + (string) (len=45) "\ttmp := make([]string, len(_ChangeTypeNames))", + (string) (len=28) "\tcopy(tmp, _ChangeTypeNames)", + (string) (len=11) "\treturn tmp", + (string) (len=1) "}", + (string) "", + (string) (len=43) "var _ChangeTypeMap = map[ChangeType]string{", + (string) (len=40) "\tChangeTypeCreate: _ChangeTypeName[0:6],", + (string) (len=41) "\tChangeTypeUpdate: _ChangeTypeName[6:12],", + (string) (len=42) "\tChangeTypeDelete: _ChangeTypeName[12:18],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=37) "func (x ChangeType) String() string {", + (string) (len=38) "\tif str, ok := _ChangeTypeMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=40) "\treturn fmt.Sprintf(\"ChangeType(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=45) "var _ChangeTypeValue = map[string]ChangeType{", + (string) (len=59) "\t_ChangeTypeName[0:6]: ChangeTypeCreate,", + (string) (len=59) "\tstrings.ToLower(_ChangeTypeName[0:6]): ChangeTypeCreate,", + (string) (len=59) "\t_ChangeTypeName[6:12]: ChangeTypeUpdate,", + (string) (len=59) "\tstrings.ToLower(_ChangeTypeName[6:12]): ChangeTypeUpdate,", + (string) (len=59) "\t_ChangeTypeName[12:18]: ChangeTypeDelete,", + (string) (len=59) "\tstrings.ToLower(_ChangeTypeName[12:18]): ChangeTypeDelete,", + (string) (len=1) "}", + (string) "", + (string) (len=64) "// ParseChangeType attempts to convert a string to a ChangeType.", + (string) (len=55) "func ParseChangeType(name string) (ChangeType, error) {", + (string) (len=41) "\tif x, ok := _ChangeTypeValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.", + (string) (len=58) "\tif x, ok := _ChangeTypeValue[strings.ToLower(name)]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=119) "\treturn ChangeType(0), fmt.Errorf(\"%s is not a valid ChangeType, try [%s]\", name, strings.Join(_ChangeTypeNames, \", \"))", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=51) "func (x ChangeType) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=55) "func (x *ChangeType) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=34) "\ttmp, err := ParseChangeType(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=97) "var _ChangeTypeErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=58) "func (x *ChangeType) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=20) "\t\t*x = ChangeType(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=20) "\t\t*x = ChangeType(v)", + (string) (len=13) "\tcase string:", + (string) (len=30) "\t\t*x, err = ParseChangeType(v)", + (string) (len=13) "\tcase []byte:", + (string) (len=38) "\t\t*x, err = ParseChangeType(string(v))", + (string) (len=17) "\tcase ChangeType:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=20) "\t\t*x = ChangeType(v)", + (string) (len=18) "\tcase *ChangeType:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=20) "\t\t*x = ChangeType(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=20) "\t\t*x = ChangeType(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = ChangeType(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = ChangeType(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=20) "\t\t*x = ChangeType(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = ChangeType(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = ChangeType(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = ChangeType(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _ChangeTypeErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=31) "\t\t*x, err = ParseChangeType(*v)", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=51) "func (x ChangeType) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "" +} diff --git a/generator/.snapshots/generator-TestExampleFile b/generator/.snapshots/Test118ExampleFile-og similarity index 100% rename from generator/.snapshots/generator-TestExampleFile rename to generator/.snapshots/Test118ExampleFile-og diff --git a/generator/.snapshots/Test118NoPrefixExampleFile-1.18 b/generator/.snapshots/Test118NoPrefixExampleFile-1.18 new file mode 100644 index 00000000..1d0af22b --- /dev/null +++ b/generator/.snapshots/Test118NoPrefixExampleFile-1.18 @@ -0,0 +1,90 @@ +([]string) (len=88) { + (string) (len=41) "// Code generated by go-enum DO NOT EDIT.", + (string) (len=13) "// Version: -", + (string) (len=14) "// Revision: -", + (string) (len=16) "// Build Date: -", + (string) (len=14) "// Built By: -", + (string) "", + (string) (len=17) "package generator", + (string) "", + (string) (len=8) "import (", + (string) (len=6) "\t\"fmt\"", + (string) (len=10) "\t\"strings\"", + (string) (len=1) ")", + (string) "", + (string) (len=7) "const (", + (string) (len=42) "\t// Create is a ChangeType of type Create.", + (string) (len=25) "\tCreate ChangeType = iota", + (string) (len=42) "\t// Update is a ChangeType of type Update.", + (string) (len=7) "\tUpdate", + (string) (len=42) "\t// Delete is a ChangeType of type Delete.", + (string) (len=7) "\tDelete", + (string) (len=1) ")", + (string) "", + (string) (len=44) "const _ChangeTypeName = \"CreateUpdateDelete\"", + (string) "", + (string) (len=43) "var _ChangeTypeMap = map[ChangeType]string{", + (string) (len=30) "\tCreate: _ChangeTypeName[0:6],", + (string) (len=31) "\tUpdate: _ChangeTypeName[6:12],", + (string) (len=32) "\tDelete: _ChangeTypeName[12:18],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=37) "func (x ChangeType) String() string {", + (string) (len=38) "\tif str, ok := _ChangeTypeMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=40) "\treturn fmt.Sprintf(\"ChangeType(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=45) "var _ChangeTypeValue = map[string]ChangeType{", + (string) (len=49) "\t_ChangeTypeName[0:6]: Create,", + (string) (len=49) "\tstrings.ToLower(_ChangeTypeName[0:6]): Create,", + (string) (len=49) "\t_ChangeTypeName[6:12]: Update,", + (string) (len=49) "\tstrings.ToLower(_ChangeTypeName[6:12]): Update,", + (string) (len=49) "\t_ChangeTypeName[12:18]: Delete,", + (string) (len=49) "\tstrings.ToLower(_ChangeTypeName[12:18]): Delete,", + (string) (len=1) "}", + (string) "", + (string) (len=64) "// ParseChangeType attempts to convert a string to a ChangeType.", + (string) (len=55) "func ParseChangeType(name string) (ChangeType, error) {", + (string) (len=41) "\tif x, ok := _ChangeTypeValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=71) "\treturn ChangeType(0), fmt.Errorf(\"%s is not a valid ChangeType\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=51) "func (x ChangeType) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=55) "func (x *ChangeType) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=34) "\ttmp, err := ParseChangeType(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=44) "func (x *ChangeType) Set(val string) error {", + (string) (len=31) "\tv, err := ParseChangeType(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=40) "func (x *ChangeType) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=36) "func (x *ChangeType) Type() string {", + (string) (len=20) "\treturn \"ChangeType\"", + (string) (len=1) "}", + (string) "" +} diff --git a/generator/.snapshots/generator-TestNoPrefixExampleFile b/generator/.snapshots/Test118NoPrefixExampleFile-og similarity index 100% rename from generator/.snapshots/generator-TestNoPrefixExampleFile rename to generator/.snapshots/Test118NoPrefixExampleFile-og diff --git a/generator/.snapshots/Test118NoPrefixExampleFileWithSnakeToCamel-1.18 b/generator/.snapshots/Test118NoPrefixExampleFileWithSnakeToCamel-1.18 new file mode 100644 index 00000000..1d0af22b --- /dev/null +++ b/generator/.snapshots/Test118NoPrefixExampleFileWithSnakeToCamel-1.18 @@ -0,0 +1,90 @@ +([]string) (len=88) { + (string) (len=41) "// Code generated by go-enum DO NOT EDIT.", + (string) (len=13) "// Version: -", + (string) (len=14) "// Revision: -", + (string) (len=16) "// Build Date: -", + (string) (len=14) "// Built By: -", + (string) "", + (string) (len=17) "package generator", + (string) "", + (string) (len=8) "import (", + (string) (len=6) "\t\"fmt\"", + (string) (len=10) "\t\"strings\"", + (string) (len=1) ")", + (string) "", + (string) (len=7) "const (", + (string) (len=42) "\t// Create is a ChangeType of type Create.", + (string) (len=25) "\tCreate ChangeType = iota", + (string) (len=42) "\t// Update is a ChangeType of type Update.", + (string) (len=7) "\tUpdate", + (string) (len=42) "\t// Delete is a ChangeType of type Delete.", + (string) (len=7) "\tDelete", + (string) (len=1) ")", + (string) "", + (string) (len=44) "const _ChangeTypeName = \"CreateUpdateDelete\"", + (string) "", + (string) (len=43) "var _ChangeTypeMap = map[ChangeType]string{", + (string) (len=30) "\tCreate: _ChangeTypeName[0:6],", + (string) (len=31) "\tUpdate: _ChangeTypeName[6:12],", + (string) (len=32) "\tDelete: _ChangeTypeName[12:18],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=37) "func (x ChangeType) String() string {", + (string) (len=38) "\tif str, ok := _ChangeTypeMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=40) "\treturn fmt.Sprintf(\"ChangeType(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=45) "var _ChangeTypeValue = map[string]ChangeType{", + (string) (len=49) "\t_ChangeTypeName[0:6]: Create,", + (string) (len=49) "\tstrings.ToLower(_ChangeTypeName[0:6]): Create,", + (string) (len=49) "\t_ChangeTypeName[6:12]: Update,", + (string) (len=49) "\tstrings.ToLower(_ChangeTypeName[6:12]): Update,", + (string) (len=49) "\t_ChangeTypeName[12:18]: Delete,", + (string) (len=49) "\tstrings.ToLower(_ChangeTypeName[12:18]): Delete,", + (string) (len=1) "}", + (string) "", + (string) (len=64) "// ParseChangeType attempts to convert a string to a ChangeType.", + (string) (len=55) "func ParseChangeType(name string) (ChangeType, error) {", + (string) (len=41) "\tif x, ok := _ChangeTypeValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=71) "\treturn ChangeType(0), fmt.Errorf(\"%s is not a valid ChangeType\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=51) "func (x ChangeType) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=55) "func (x *ChangeType) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=34) "\ttmp, err := ParseChangeType(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=44) "func (x *ChangeType) Set(val string) error {", + (string) (len=31) "\tv, err := ParseChangeType(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=40) "func (x *ChangeType) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=36) "func (x *ChangeType) Type() string {", + (string) (len=20) "\treturn \"ChangeType\"", + (string) (len=1) "}", + (string) "" +} diff --git a/generator/.snapshots/generator-TestNoPrefixExampleFileWithSnakeToCamel b/generator/.snapshots/Test118NoPrefixExampleFileWithSnakeToCamel-og similarity index 100% rename from generator/.snapshots/generator-TestNoPrefixExampleFileWithSnakeToCamel rename to generator/.snapshots/Test118NoPrefixExampleFileWithSnakeToCamel-og diff --git a/generator/.snapshots/TestCustomPrefixExampleFile b/generator/.snapshots/TestCustomPrefixExampleFile new file mode 100644 index 00000000..e92966fa --- /dev/null +++ b/generator/.snapshots/TestCustomPrefixExampleFile @@ -0,0 +1,3379 @@ +([]string) (len=3377) { + (string) (len=41) "// Code generated by go-enum DO NOT EDIT.", + (string) (len=13) "// Version: -", + (string) (len=14) "// Revision: -", + (string) (len=16) "// Build Date: -", + (string) (len=14) "// Built By: -", + (string) "", + (string) (len=17) "package generator", + (string) "", + (string) (len=8) "import (", + (string) (len=22) "\t\"database/sql/driver\"", + (string) (len=16) "\t\"encoding/json\"", + (string) (len=6) "\t\"fmt\"", + (string) (len=10) "\t\"strconv\"", + (string) (len=10) "\t\"strings\"", + (string) "", + (string) (len=24) "\t\"github.com/pkg/errors\"", + (string) (len=1) ")", + (string) "", + (string) (len=7) "const (", + (string) (len=46) "\t// Custom_prefix_Cat is a Animal of type Cat.", + (string) (len=32) "\tCustom_prefix_Cat Animal = iota", + (string) (len=46) "\t// Custom_prefix_Dog is a Animal of type Dog.", + (string) (len=18) "\tCustom_prefix_Dog", + (string) (len=48) "\t// Custom_prefix_Fish is a Animal of type Fish.", + (string) (len=19) "\tCustom_prefix_Fish", + (string) (len=1) ")", + (string) "", + (string) (len=32) "const _AnimalName = \"CatDogFish\"", + (string) "", + (string) (len=35) "var _AnimalMap = map[Animal]string{", + (string) (len=38) "\tCustom_prefix_Cat: _AnimalName[0:3],", + (string) (len=38) "\tCustom_prefix_Dog: _AnimalName[3:6],", + (string) (len=39) "\tCustom_prefix_Fish: _AnimalName[6:10],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=33) "func (x Animal) String() string {", + (string) (len=34) "\tif str, ok := _AnimalMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=36) "\treturn fmt.Sprintf(\"Animal(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=37) "var _AnimalValue = map[string]Animal{", + (string) (len=55) "\t_AnimalName[0:3]: Custom_prefix_Cat,", + (string) (len=55) "\tstrings.ToLower(_AnimalName[0:3]): Custom_prefix_Cat,", + (string) (len=55) "\t_AnimalName[3:6]: Custom_prefix_Dog,", + (string) (len=55) "\tstrings.ToLower(_AnimalName[3:6]): Custom_prefix_Dog,", + (string) (len=56) "\t_AnimalName[6:10]: Custom_prefix_Fish,", + (string) (len=56) "\tstrings.ToLower(_AnimalName[6:10]): Custom_prefix_Fish,", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// ParseAnimal attempts to convert a string to a Animal.", + (string) (len=47) "func ParseAnimal(name string) (Animal, error) {", + (string) (len=37) "\tif x, ok := _AnimalValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=63) "\treturn Animal(0), fmt.Errorf(\"%s is not a valid Animal\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=31) "func (x Animal) Ptr() *Animal {", + (string) (len=10) "\treturn &x", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=47) "func (x Animal) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=51) "func (x *Animal) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=30) "\ttmp, err := ParseAnimal(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=93) "var _AnimalErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=54) "func (x *Animal) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=16) "\t\t*x = Animal(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=16) "\t\t*x = Animal(v)", + (string) (len=13) "\tcase string:", + (string) (len=26) "\t\t*x, err = ParseAnimal(v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {", + (string) (len=30) "\t\t\t\t*x, err = Animal(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase []byte:", + (string) (len=34) "\t\t*x, err = ParseAnimal(string(v))", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {", + (string) (len=30) "\t\t\t\t*x, err = Animal(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase Animal:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=16) "\t\t*x = Animal(v)", + (string) (len=14) "\tcase *Animal:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=16) "\t\t*x = Animal(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=16) "\t\t*x = Animal(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=17) "\t\t*x = Animal(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=17) "\t\t*x = Animal(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=16) "\t\t*x = Animal(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=17) "\t\t*x = Animal(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=17) "\t\t*x = Animal(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=17) "\t\t*x = Animal(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=27) "\t\t*x, err = ParseAnimal(*v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {", + (string) (len=30) "\t\t\t\t*x, err = Animal(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=47) "func (x Animal) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=40) "func (x *Animal) Set(val string) error {", + (string) (len=27) "\tv, err := ParseAnimal(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=36) "func (x *Animal) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=32) "func (x *Animal) Type() string {", + (string) (len=16) "\treturn \"Animal\"", + (string) (len=1) "}", + (string) "", + (string) (len=24) "type NullAnimal struct {", + (string) (len=14) "\tAnimal Animal", + (string) (len=12) "\tValid bool", + (string) (len=12) "\tSet bool", + (string) (len=1) "}", + (string) "", + (string) (len=52) "func NewNullAnimal(val interface{}) (x NullAnimal) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=58) "func (x *NullAnimal) Scan(value interface{}) (err error) {", + (string) (len=13) "\tx.Set = true", + (string) (len=18) "\tif value == nil {", + (string) (len=38) "\t\tx.Animal, x.Valid = Animal(0), false", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=27) "\terr = x.Animal.Scan(value)", + (string) (len=23) "\tx.Valid = (err == nil)", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=51) "func (x NullAnimal) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=46) "\t// driver.Value accepts int64 for int values.", + (string) (len=28) "\treturn int64(x.Animal), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// MarshalJSON correctly serializes a NullAnimal to JSON.", + (string) (len=51) "func (n NullAnimal) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=31) "\t\treturn json.Marshal(n.Animal)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=63) "// UnmarshalJSON correctly deserializes a NullAnimal from JSON.", + (string) (len=52) "func (n *NullAnimal) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=27) "type NullAnimalStr struct {", + (string) (len=11) "\tNullAnimal", + (string) (len=1) "}", + (string) "", + (string) (len=58) "func NewNullAnimalStr(val interface{}) (x NullAnimalStr) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=54) "func (x NullAnimalStr) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=30) "\treturn x.Animal.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// MarshalJSON correctly serializes a NullAnimal to JSON.", + (string) (len=54) "func (n NullAnimalStr) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=31) "\t\treturn json.Marshal(n.Animal)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=63) "// UnmarshalJSON correctly deserializes a NullAnimal from JSON.", + (string) (len=55) "func (n *NullAnimalStr) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=59) "\t// Custom_prefix_Test_lower is a Cases of type Test_lower.", + (string) (len=38) "\tCustom_prefix_Test_lower Cases = iota", + (string) (len=63) "\t// Custom_prefix_Test_capital is a Cases of type Test_capital.", + (string) (len=27) "\tCustom_prefix_Test_capital", + (string) (len=81) "\t// Custom_prefix_AnotherLowerCaseStart is a Cases of type AnotherLowerCaseStart.", + (string) (len=36) "\tCustom_prefix_AnotherLowerCaseStart", + (string) (len=1) ")", + (string) "", + (string) (len=64) "const _CasesName = \"test_lowerTest_capitalanotherLowerCaseStart\"", + (string) "", + (string) (len=33) "var _CasesMap = map[Cases]string{", + (string) (len=55) "\tCustom_prefix_Test_lower: _CasesName[0:10],", + (string) (len=56) "\tCustom_prefix_Test_capital: _CasesName[10:22],", + (string) (len=56) "\tCustom_prefix_AnotherLowerCaseStart: _CasesName[22:43],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=32) "func (x Cases) String() string {", + (string) (len=33) "\tif str, ok := _CasesMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=35) "\treturn fmt.Sprintf(\"Cases(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=35) "var _CasesValue = map[string]Cases{", + (string) (len=62) "\t_CasesName[0:10]: Custom_prefix_Test_lower,", + (string) (len=62) "\tstrings.ToLower(_CasesName[0:10]): Custom_prefix_Test_lower,", + (string) (len=64) "\t_CasesName[10:22]: Custom_prefix_Test_capital,", + (string) (len=64) "\tstrings.ToLower(_CasesName[10:22]): Custom_prefix_Test_capital,", + (string) (len=73) "\t_CasesName[22:43]: Custom_prefix_AnotherLowerCaseStart,", + (string) (len=73) "\tstrings.ToLower(_CasesName[22:43]): Custom_prefix_AnotherLowerCaseStart,", + (string) (len=1) "}", + (string) "", + (string) (len=54) "// ParseCases attempts to convert a string to a Cases.", + (string) (len=45) "func ParseCases(name string) (Cases, error) {", + (string) (len=36) "\tif x, ok := _CasesValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=61) "\treturn Cases(0), fmt.Errorf(\"%s is not a valid Cases\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=29) "func (x Cases) Ptr() *Cases {", + (string) (len=10) "\treturn &x", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=46) "func (x Cases) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=50) "func (x *Cases) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=29) "\ttmp, err := ParseCases(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=92) "var _CasesErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=53) "func (x *Cases) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=15) "\t\t*x = Cases(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=15) "\t\t*x = Cases(v)", + (string) (len=13) "\tcase string:", + (string) (len=25) "\t\t*x, err = ParseCases(v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {", + (string) (len=29) "\t\t\t\t*x, err = Cases(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase []byte:", + (string) (len=33) "\t\t*x, err = ParseCases(string(v))", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {", + (string) (len=29) "\t\t\t\t*x, err = Cases(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=12) "\tcase Cases:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=15) "\t\t*x = Cases(v)", + (string) (len=13) "\tcase *Cases:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=15) "\t\t*x = Cases(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=15) "\t\t*x = Cases(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Cases(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Cases(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\t*x = Cases(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Cases(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Cases(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Cases(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=26) "\t\t*x, err = ParseCases(*v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {", + (string) (len=29) "\t\t\t\t*x, err = Cases(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=46) "func (x Cases) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=39) "func (x *Cases) Set(val string) error {", + (string) (len=26) "\tv, err := ParseCases(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=35) "func (x *Cases) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=31) "func (x *Cases) Type() string {", + (string) (len=15) "\treturn \"Cases\"", + (string) (len=1) "}", + (string) "", + (string) (len=23) "type NullCases struct {", + (string) (len=12) "\tCases Cases", + (string) (len=11) "\tValid bool", + (string) (len=11) "\tSet bool", + (string) (len=1) "}", + (string) "", + (string) (len=50) "func NewNullCases(val interface{}) (x NullCases) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=57) "func (x *NullCases) Scan(value interface{}) (err error) {", + (string) (len=13) "\tx.Set = true", + (string) (len=18) "\tif value == nil {", + (string) (len=36) "\t\tx.Cases, x.Valid = Cases(0), false", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=26) "\terr = x.Cases.Scan(value)", + (string) (len=23) "\tx.Valid = (err == nil)", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=50) "func (x NullCases) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=46) "\t// driver.Value accepts int64 for int values.", + (string) (len=27) "\treturn int64(x.Cases), nil", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// MarshalJSON correctly serializes a NullCases to JSON.", + (string) (len=50) "func (n NullCases) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=30) "\t\treturn json.Marshal(n.Cases)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// UnmarshalJSON correctly deserializes a NullCases from JSON.", + (string) (len=51) "func (n *NullCases) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=26) "type NullCasesStr struct {", + (string) (len=10) "\tNullCases", + (string) (len=1) "}", + (string) "", + (string) (len=56) "func NewNullCasesStr(val interface{}) (x NullCasesStr) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=53) "func (x NullCasesStr) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=29) "\treturn x.Cases.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// MarshalJSON correctly serializes a NullCases to JSON.", + (string) (len=53) "func (n NullCasesStr) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=30) "\t\treturn json.Marshal(n.Cases)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// UnmarshalJSON correctly deserializes a NullCases from JSON.", + (string) (len=54) "func (n *NullCasesStr) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=49) "\t// Custom_prefix_Black is a Color of type Black.", + (string) (len=33) "\tCustom_prefix_Black Color = iota", + (string) (len=49) "\t// Custom_prefix_White is a Color of type White.", + (string) (len=20) "\tCustom_prefix_White", + (string) (len=45) "\t// Custom_prefix_Red is a Color of type Red.", + (string) (len=18) "\tCustom_prefix_Red", + (string) (len=49) "\t// Custom_prefix_Green is a Color of type Green.", + (string) (len=20) "\tCustom_prefix_Green", + (string) (len=47) "\t// Custom_prefix_Blue is a Color of type Blue.", + (string) (len=37) "\tCustom_prefix_Blue Color = iota + 29", + (string) (len=47) "\t// Custom_prefix_Grey is a Color of type Grey.", + (string) (len=19) "\tCustom_prefix_Grey", + (string) (len=51) "\t// Custom_prefix_Yellow is a Color of type Yellow.", + (string) (len=21) "\tCustom_prefix_Yellow", + (string) (len=1) ")", + (string) "", + (string) (len=53) "const _ColorName = \"BlackWhiteRedGreenBluegreyyellow\"", + (string) "", + (string) (len=33) "var _ColorMap = map[Color]string{", + (string) (len=39) "\tCustom_prefix_Black: _ColorName[0:5],", + (string) (len=40) "\tCustom_prefix_White: _ColorName[5:10],", + (string) (len=41) "\tCustom_prefix_Red: _ColorName[10:13],", + (string) (len=41) "\tCustom_prefix_Green: _ColorName[13:18],", + (string) (len=41) "\tCustom_prefix_Blue: _ColorName[18:22],", + (string) (len=41) "\tCustom_prefix_Grey: _ColorName[22:26],", + (string) (len=41) "\tCustom_prefix_Yellow: _ColorName[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=32) "func (x Color) String() string {", + (string) (len=33) "\tif str, ok := _ColorMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=35) "\treturn fmt.Sprintf(\"Color(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=35) "var _ColorValue = map[string]Color{", + (string) (len=57) "\t_ColorName[0:5]: Custom_prefix_Black,", + (string) (len=57) "\tstrings.ToLower(_ColorName[0:5]): Custom_prefix_Black,", + (string) (len=57) "\t_ColorName[5:10]: Custom_prefix_White,", + (string) (len=57) "\tstrings.ToLower(_ColorName[5:10]): Custom_prefix_White,", + (string) (len=55) "\t_ColorName[10:13]: Custom_prefix_Red,", + (string) (len=55) "\tstrings.ToLower(_ColorName[10:13]): Custom_prefix_Red,", + (string) (len=57) "\t_ColorName[13:18]: Custom_prefix_Green,", + (string) (len=57) "\tstrings.ToLower(_ColorName[13:18]): Custom_prefix_Green,", + (string) (len=56) "\t_ColorName[18:22]: Custom_prefix_Blue,", + (string) (len=56) "\tstrings.ToLower(_ColorName[18:22]): Custom_prefix_Blue,", + (string) (len=56) "\t_ColorName[22:26]: Custom_prefix_Grey,", + (string) (len=56) "\tstrings.ToLower(_ColorName[22:26]): Custom_prefix_Grey,", + (string) (len=58) "\t_ColorName[26:32]: Custom_prefix_Yellow,", + (string) (len=58) "\tstrings.ToLower(_ColorName[26:32]): Custom_prefix_Yellow,", + (string) (len=1) "}", + (string) "", + (string) (len=54) "// ParseColor attempts to convert a string to a Color.", + (string) (len=45) "func ParseColor(name string) (Color, error) {", + (string) (len=36) "\tif x, ok := _ColorValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=61) "\treturn Color(0), fmt.Errorf(\"%s is not a valid Color\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=29) "func (x Color) Ptr() *Color {", + (string) (len=10) "\treturn &x", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=46) "func (x Color) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=50) "func (x *Color) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=29) "\ttmp, err := ParseColor(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=92) "var _ColorErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=53) "func (x *Color) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=15) "\t\t*x = Color(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=15) "\t\t*x = Color(v)", + (string) (len=13) "\tcase string:", + (string) (len=25) "\t\t*x, err = ParseColor(v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {", + (string) (len=29) "\t\t\t\t*x, err = Color(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase []byte:", + (string) (len=33) "\t\t*x, err = ParseColor(string(v))", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {", + (string) (len=29) "\t\t\t\t*x, err = Color(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=12) "\tcase Color:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=15) "\t\t*x = Color(v)", + (string) (len=13) "\tcase *Color:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=15) "\t\t*x = Color(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=15) "\t\t*x = Color(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Color(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Color(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\t*x = Color(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Color(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Color(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Color(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=26) "\t\t*x, err = ParseColor(*v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {", + (string) (len=29) "\t\t\t\t*x, err = Color(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=46) "func (x Color) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=39) "func (x *Color) Set(val string) error {", + (string) (len=26) "\tv, err := ParseColor(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=35) "func (x *Color) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=31) "func (x *Color) Type() string {", + (string) (len=15) "\treturn \"Color\"", + (string) (len=1) "}", + (string) "", + (string) (len=23) "type NullColor struct {", + (string) (len=12) "\tColor Color", + (string) (len=11) "\tValid bool", + (string) (len=11) "\tSet bool", + (string) (len=1) "}", + (string) "", + (string) (len=50) "func NewNullColor(val interface{}) (x NullColor) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=57) "func (x *NullColor) Scan(value interface{}) (err error) {", + (string) (len=13) "\tx.Set = true", + (string) (len=18) "\tif value == nil {", + (string) (len=36) "\t\tx.Color, x.Valid = Color(0), false", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=26) "\terr = x.Color.Scan(value)", + (string) (len=23) "\tx.Valid = (err == nil)", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=50) "func (x NullColor) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=46) "\t// driver.Value accepts int64 for int values.", + (string) (len=27) "\treturn int64(x.Color), nil", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// MarshalJSON correctly serializes a NullColor to JSON.", + (string) (len=50) "func (n NullColor) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=30) "\t\treturn json.Marshal(n.Color)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// UnmarshalJSON correctly deserializes a NullColor from JSON.", + (string) (len=51) "func (n *NullColor) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=26) "type NullColorStr struct {", + (string) (len=10) "\tNullColor", + (string) (len=1) "}", + (string) "", + (string) (len=56) "func NewNullColorStr(val interface{}) (x NullColorStr) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=53) "func (x NullColorStr) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=29) "\treturn x.Color.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// MarshalJSON correctly serializes a NullColor to JSON.", + (string) (len=53) "func (n NullColorStr) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=30) "\t\treturn json.Marshal(n.Color)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// UnmarshalJSON correctly deserializes a NullColor from JSON.", + (string) (len=54) "func (n *NullColorStr) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=60) "\t// Custom_prefix_Black is a ColorWithComment of type Black.", + (string) (len=44) "\tCustom_prefix_Black ColorWithComment = iota", + (string) (len=60) "\t// Custom_prefix_White is a ColorWithComment of type White.", + (string) (len=20) "\tCustom_prefix_White", + (string) (len=56) "\t// Custom_prefix_Red is a ColorWithComment of type Red.", + (string) (len=18) "\tCustom_prefix_Red", + (string) (len=60) "\t// Custom_prefix_Green is a ColorWithComment of type Green.", + (string) (len=20) "\tCustom_prefix_Green", + (string) (len=58) "\t// Custom_prefix_Blue is a ColorWithComment of type Blue.", + (string) (len=23) "\t// Blue starts with 33", + (string) (len=48) "\tCustom_prefix_Blue ColorWithComment = iota + 29", + (string) (len=58) "\t// Custom_prefix_Grey is a ColorWithComment of type Grey.", + (string) (len=19) "\tCustom_prefix_Grey", + (string) (len=62) "\t// Custom_prefix_Yellow is a ColorWithComment of type Yellow.", + (string) (len=21) "\tCustom_prefix_Yellow", + (string) (len=1) ")", + (string) "", + (string) (len=64) "const _ColorWithCommentName = \"BlackWhiteRedGreenBluegreyyellow\"", + (string) "", + (string) (len=55) "var _ColorWithCommentMap = map[ColorWithComment]string{", + (string) (len=50) "\tCustom_prefix_Black: _ColorWithCommentName[0:5],", + (string) (len=51) "\tCustom_prefix_White: _ColorWithCommentName[5:10],", + (string) (len=52) "\tCustom_prefix_Red: _ColorWithCommentName[10:13],", + (string) (len=52) "\tCustom_prefix_Green: _ColorWithCommentName[13:18],", + (string) (len=52) "\tCustom_prefix_Blue: _ColorWithCommentName[18:22],", + (string) (len=52) "\tCustom_prefix_Grey: _ColorWithCommentName[22:26],", + (string) (len=52) "\tCustom_prefix_Yellow: _ColorWithCommentName[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=43) "func (x ColorWithComment) String() string {", + (string) (len=44) "\tif str, ok := _ColorWithCommentMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=46) "\treturn fmt.Sprintf(\"ColorWithComment(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=57) "var _ColorWithCommentValue = map[string]ColorWithComment{", + (string) (len=68) "\t_ColorWithCommentName[0:5]: Custom_prefix_Black,", + (string) (len=68) "\tstrings.ToLower(_ColorWithCommentName[0:5]): Custom_prefix_Black,", + (string) (len=68) "\t_ColorWithCommentName[5:10]: Custom_prefix_White,", + (string) (len=68) "\tstrings.ToLower(_ColorWithCommentName[5:10]): Custom_prefix_White,", + (string) (len=66) "\t_ColorWithCommentName[10:13]: Custom_prefix_Red,", + (string) (len=66) "\tstrings.ToLower(_ColorWithCommentName[10:13]): Custom_prefix_Red,", + (string) (len=68) "\t_ColorWithCommentName[13:18]: Custom_prefix_Green,", + (string) (len=68) "\tstrings.ToLower(_ColorWithCommentName[13:18]): Custom_prefix_Green,", + (string) (len=67) "\t_ColorWithCommentName[18:22]: Custom_prefix_Blue,", + (string) (len=67) "\tstrings.ToLower(_ColorWithCommentName[18:22]): Custom_prefix_Blue,", + (string) (len=67) "\t_ColorWithCommentName[22:26]: Custom_prefix_Grey,", + (string) (len=67) "\tstrings.ToLower(_ColorWithCommentName[22:26]): Custom_prefix_Grey,", + (string) (len=69) "\t_ColorWithCommentName[26:32]: Custom_prefix_Yellow,", + (string) (len=69) "\tstrings.ToLower(_ColorWithCommentName[26:32]): Custom_prefix_Yellow,", + (string) (len=1) "}", + (string) "", + (string) (len=76) "// ParseColorWithComment attempts to convert a string to a ColorWithComment.", + (string) (len=67) "func ParseColorWithComment(name string) (ColorWithComment, error) {", + (string) (len=47) "\tif x, ok := _ColorWithCommentValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=83) "\treturn ColorWithComment(0), fmt.Errorf(\"%s is not a valid ColorWithComment\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=51) "func (x ColorWithComment) Ptr() *ColorWithComment {", + (string) (len=10) "\treturn &x", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=57) "func (x ColorWithComment) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=61) "func (x *ColorWithComment) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=40) "\ttmp, err := ParseColorWithComment(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=103) "var _ColorWithCommentErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=64) "func (x *ColorWithComment) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=26) "\t\t*x = ColorWithComment(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=26) "\t\t*x = ColorWithComment(v)", + (string) (len=13) "\tcase string:", + (string) (len=36) "\t\t*x, err = ParseColorWithComment(v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {", + (string) (len=40) "\t\t\t\t*x, err = ColorWithComment(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase []byte:", + (string) (len=44) "\t\t*x, err = ParseColorWithComment(string(v))", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {", + (string) (len=40) "\t\t\t\t*x, err = ColorWithComment(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=23) "\tcase ColorWithComment:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=26) "\t\t*x = ColorWithComment(v)", + (string) (len=24) "\tcase *ColorWithComment:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=26) "\t\t*x = ColorWithComment(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=26) "\t\t*x = ColorWithComment(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=27) "\t\t*x = ColorWithComment(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=27) "\t\t*x = ColorWithComment(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=26) "\t\t*x = ColorWithComment(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=27) "\t\t*x = ColorWithComment(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=27) "\t\t*x = ColorWithComment(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=27) "\t\t*x = ColorWithComment(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=37) "\t\t*x, err = ParseColorWithComment(*v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {", + (string) (len=40) "\t\t\t\t*x, err = ColorWithComment(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=57) "func (x ColorWithComment) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=50) "func (x *ColorWithComment) Set(val string) error {", + (string) (len=37) "\tv, err := ParseColorWithComment(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=46) "func (x *ColorWithComment) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=42) "func (x *ColorWithComment) Type() string {", + (string) (len=26) "\treturn \"ColorWithComment\"", + (string) (len=1) "}", + (string) "", + (string) (len=34) "type NullColorWithComment struct {", + (string) (len=34) "\tColorWithComment ColorWithComment", + (string) (len=22) "\tValid bool", + (string) (len=22) "\tSet bool", + (string) (len=1) "}", + (string) "", + (string) (len=72) "func NewNullColorWithComment(val interface{}) (x NullColorWithComment) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=68) "func (x *NullColorWithComment) Scan(value interface{}) (err error) {", + (string) (len=13) "\tx.Set = true", + (string) (len=18) "\tif value == nil {", + (string) (len=58) "\t\tx.ColorWithComment, x.Valid = ColorWithComment(0), false", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\terr = x.ColorWithComment.Scan(value)", + (string) (len=23) "\tx.Valid = (err == nil)", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=61) "func (x NullColorWithComment) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=46) "\t// driver.Value accepts int64 for int values.", + (string) (len=38) "\treturn int64(x.ColorWithComment), nil", + (string) (len=1) "}", + (string) "", + (string) (len=67) "// MarshalJSON correctly serializes a NullColorWithComment to JSON.", + (string) (len=61) "func (n NullColorWithComment) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=41) "\t\treturn json.Marshal(n.ColorWithComment)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=73) "// UnmarshalJSON correctly deserializes a NullColorWithComment from JSON.", + (string) (len=62) "func (n *NullColorWithComment) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=37) "type NullColorWithCommentStr struct {", + (string) (len=21) "\tNullColorWithComment", + (string) (len=1) "}", + (string) "", + (string) (len=78) "func NewNullColorWithCommentStr(val interface{}) (x NullColorWithCommentStr) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=64) "func (x NullColorWithCommentStr) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=40) "\treturn x.ColorWithComment.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=67) "// MarshalJSON correctly serializes a NullColorWithComment to JSON.", + (string) (len=64) "func (n NullColorWithCommentStr) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=41) "\t\treturn json.Marshal(n.ColorWithComment)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=73) "// UnmarshalJSON correctly deserializes a NullColorWithComment from JSON.", + (string) (len=65) "func (n *NullColorWithCommentStr) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=61) "\t// Custom_prefix_Black is a ColorWithComment2 of type Black.", + (string) (len=45) "\tCustom_prefix_Black ColorWithComment2 = iota", + (string) (len=61) "\t// Custom_prefix_White is a ColorWithComment2 of type White.", + (string) (len=20) "\tCustom_prefix_White", + (string) (len=57) "\t// Custom_prefix_Red is a ColorWithComment2 of type Red.", + (string) (len=18) "\tCustom_prefix_Red", + (string) (len=61) "\t// Custom_prefix_Green is a ColorWithComment2 of type Green.", + (string) (len=20) "\tCustom_prefix_Green", + (string) (len=59) "\t// Custom_prefix_Blue is a ColorWithComment2 of type Blue.", + (string) (len=23) "\t// Blue starts with 33", + (string) (len=49) "\tCustom_prefix_Blue ColorWithComment2 = iota + 29", + (string) (len=59) "\t// Custom_prefix_Grey is a ColorWithComment2 of type Grey.", + (string) (len=19) "\tCustom_prefix_Grey", + (string) (len=63) "\t// Custom_prefix_Yellow is a ColorWithComment2 of type Yellow.", + (string) (len=21) "\tCustom_prefix_Yellow", + (string) (len=1) ")", + (string) "", + (string) (len=65) "const _ColorWithComment2Name = \"BlackWhiteRedGreenBluegreyyellow\"", + (string) "", + (string) (len=57) "var _ColorWithComment2Map = map[ColorWithComment2]string{", + (string) (len=51) "\tCustom_prefix_Black: _ColorWithComment2Name[0:5],", + (string) (len=52) "\tCustom_prefix_White: _ColorWithComment2Name[5:10],", + (string) (len=53) "\tCustom_prefix_Red: _ColorWithComment2Name[10:13],", + (string) (len=53) "\tCustom_prefix_Green: _ColorWithComment2Name[13:18],", + (string) (len=53) "\tCustom_prefix_Blue: _ColorWithComment2Name[18:22],", + (string) (len=53) "\tCustom_prefix_Grey: _ColorWithComment2Name[22:26],", + (string) (len=53) "\tCustom_prefix_Yellow: _ColorWithComment2Name[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=44) "func (x ColorWithComment2) String() string {", + (string) (len=45) "\tif str, ok := _ColorWithComment2Map[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=47) "\treturn fmt.Sprintf(\"ColorWithComment2(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=59) "var _ColorWithComment2Value = map[string]ColorWithComment2{", + (string) (len=69) "\t_ColorWithComment2Name[0:5]: Custom_prefix_Black,", + (string) (len=69) "\tstrings.ToLower(_ColorWithComment2Name[0:5]): Custom_prefix_Black,", + (string) (len=69) "\t_ColorWithComment2Name[5:10]: Custom_prefix_White,", + (string) (len=69) "\tstrings.ToLower(_ColorWithComment2Name[5:10]): Custom_prefix_White,", + (string) (len=67) "\t_ColorWithComment2Name[10:13]: Custom_prefix_Red,", + (string) (len=67) "\tstrings.ToLower(_ColorWithComment2Name[10:13]): Custom_prefix_Red,", + (string) (len=69) "\t_ColorWithComment2Name[13:18]: Custom_prefix_Green,", + (string) (len=69) "\tstrings.ToLower(_ColorWithComment2Name[13:18]): Custom_prefix_Green,", + (string) (len=68) "\t_ColorWithComment2Name[18:22]: Custom_prefix_Blue,", + (string) (len=68) "\tstrings.ToLower(_ColorWithComment2Name[18:22]): Custom_prefix_Blue,", + (string) (len=68) "\t_ColorWithComment2Name[22:26]: Custom_prefix_Grey,", + (string) (len=68) "\tstrings.ToLower(_ColorWithComment2Name[22:26]): Custom_prefix_Grey,", + (string) (len=70) "\t_ColorWithComment2Name[26:32]: Custom_prefix_Yellow,", + (string) (len=70) "\tstrings.ToLower(_ColorWithComment2Name[26:32]): Custom_prefix_Yellow,", + (string) (len=1) "}", + (string) "", + (string) (len=78) "// ParseColorWithComment2 attempts to convert a string to a ColorWithComment2.", + (string) (len=69) "func ParseColorWithComment2(name string) (ColorWithComment2, error) {", + (string) (len=48) "\tif x, ok := _ColorWithComment2Value[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=85) "\treturn ColorWithComment2(0), fmt.Errorf(\"%s is not a valid ColorWithComment2\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "func (x ColorWithComment2) Ptr() *ColorWithComment2 {", + (string) (len=10) "\treturn &x", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=58) "func (x ColorWithComment2) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=62) "func (x *ColorWithComment2) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=41) "\ttmp, err := ParseColorWithComment2(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=104) "var _ColorWithComment2ErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=65) "func (x *ColorWithComment2) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=27) "\t\t*x = ColorWithComment2(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=27) "\t\t*x = ColorWithComment2(v)", + (string) (len=13) "\tcase string:", + (string) (len=37) "\t\t*x, err = ParseColorWithComment2(v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {", + (string) (len=41) "\t\t\t\t*x, err = ColorWithComment2(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase []byte:", + (string) (len=45) "\t\t*x, err = ParseColorWithComment2(string(v))", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {", + (string) (len=41) "\t\t\t\t*x, err = ColorWithComment2(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=24) "\tcase ColorWithComment2:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=27) "\t\t*x = ColorWithComment2(v)", + (string) (len=25) "\tcase *ColorWithComment2:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=27) "\t\t*x = ColorWithComment2(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=27) "\t\t*x = ColorWithComment2(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment2(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment2(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=27) "\t\t*x = ColorWithComment2(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment2(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment2(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment2(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=38) "\t\t*x, err = ParseColorWithComment2(*v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {", + (string) (len=41) "\t\t\t\t*x, err = ColorWithComment2(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=58) "func (x ColorWithComment2) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=51) "func (x *ColorWithComment2) Set(val string) error {", + (string) (len=38) "\tv, err := ParseColorWithComment2(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=47) "func (x *ColorWithComment2) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=43) "func (x *ColorWithComment2) Type() string {", + (string) (len=27) "\treturn \"ColorWithComment2\"", + (string) (len=1) "}", + (string) "", + (string) (len=35) "type NullColorWithComment2 struct {", + (string) (len=36) "\tColorWithComment2 ColorWithComment2", + (string) (len=23) "\tValid bool", + (string) (len=23) "\tSet bool", + (string) (len=1) "}", + (string) "", + (string) (len=74) "func NewNullColorWithComment2(val interface{}) (x NullColorWithComment2) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=69) "func (x *NullColorWithComment2) Scan(value interface{}) (err error) {", + (string) (len=13) "\tx.Set = true", + (string) (len=18) "\tif value == nil {", + (string) (len=60) "\t\tx.ColorWithComment2, x.Valid = ColorWithComment2(0), false", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=38) "\terr = x.ColorWithComment2.Scan(value)", + (string) (len=23) "\tx.Valid = (err == nil)", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=62) "func (x NullColorWithComment2) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=46) "\t// driver.Value accepts int64 for int values.", + (string) (len=39) "\treturn int64(x.ColorWithComment2), nil", + (string) (len=1) "}", + (string) "", + (string) (len=68) "// MarshalJSON correctly serializes a NullColorWithComment2 to JSON.", + (string) (len=62) "func (n NullColorWithComment2) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=42) "\t\treturn json.Marshal(n.ColorWithComment2)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=74) "// UnmarshalJSON correctly deserializes a NullColorWithComment2 from JSON.", + (string) (len=63) "func (n *NullColorWithComment2) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=38) "type NullColorWithComment2Str struct {", + (string) (len=22) "\tNullColorWithComment2", + (string) (len=1) "}", + (string) "", + (string) (len=80) "func NewNullColorWithComment2Str(val interface{}) (x NullColorWithComment2Str) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=65) "func (x NullColorWithComment2Str) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=41) "\treturn x.ColorWithComment2.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=68) "// MarshalJSON correctly serializes a NullColorWithComment2 to JSON.", + (string) (len=65) "func (n NullColorWithComment2Str) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=42) "\t\treturn json.Marshal(n.ColorWithComment2)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=74) "// UnmarshalJSON correctly deserializes a NullColorWithComment2 from JSON.", + (string) (len=66) "func (n *NullColorWithComment2Str) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=61) "\t// Custom_prefix_Black is a ColorWithComment3 of type Black.", + (string) (len=45) "\tCustom_prefix_Black ColorWithComment3 = iota", + (string) (len=61) "\t// Custom_prefix_White is a ColorWithComment3 of type White.", + (string) (len=20) "\tCustom_prefix_White", + (string) (len=57) "\t// Custom_prefix_Red is a ColorWithComment3 of type Red.", + (string) (len=18) "\tCustom_prefix_Red", + (string) (len=61) "\t// Custom_prefix_Green is a ColorWithComment3 of type Green.", + (string) (len=24) "\t// Green starts with 33", + (string) (len=50) "\tCustom_prefix_Green ColorWithComment3 = iota + 30", + (string) (len=59) "\t// Custom_prefix_Blue is a ColorWithComment3 of type Blue.", + (string) (len=19) "\tCustom_prefix_Blue", + (string) (len=59) "\t// Custom_prefix_Grey is a ColorWithComment3 of type Grey.", + (string) (len=19) "\tCustom_prefix_Grey", + (string) (len=63) "\t// Custom_prefix_Yellow is a ColorWithComment3 of type Yellow.", + (string) (len=21) "\tCustom_prefix_Yellow", + (string) (len=70) "\t// Custom_prefix_BlueGreen is a ColorWithComment3 of type Blue-Green.", + (string) (len=22) "\t// blue-green comment", + (string) (len=24) "\tCustom_prefix_BlueGreen", + (string) (len=70) "\t// Custom_prefix_RedOrange is a ColorWithComment3 of type Red-Orange.", + (string) (len=24) "\tCustom_prefix_RedOrange", + (string) (len=79) "\t// Custom_prefix_RedOrangeBlue is a ColorWithComment3 of type Red-Orange-Blue.", + (string) (len=28) "\tCustom_prefix_RedOrangeBlue", + (string) (len=1) ")", + (string) "", + (string) (len=100) "const _ColorWithComment3Name = \"BlackWhiteRedGreenBluegreyyellowblue-greenred-orangered-orange-blue\"", + (string) "", + (string) (len=57) "var _ColorWithComment3Map = map[ColorWithComment3]string{", + (string) (len=58) "\tCustom_prefix_Black: _ColorWithComment3Name[0:5],", + (string) (len=59) "\tCustom_prefix_White: _ColorWithComment3Name[5:10],", + (string) (len=60) "\tCustom_prefix_Red: _ColorWithComment3Name[10:13],", + (string) (len=60) "\tCustom_prefix_Green: _ColorWithComment3Name[13:18],", + (string) (len=60) "\tCustom_prefix_Blue: _ColorWithComment3Name[18:22],", + (string) (len=60) "\tCustom_prefix_Grey: _ColorWithComment3Name[22:26],", + (string) (len=60) "\tCustom_prefix_Yellow: _ColorWithComment3Name[26:32],", + (string) (len=60) "\tCustom_prefix_BlueGreen: _ColorWithComment3Name[32:42],", + (string) (len=60) "\tCustom_prefix_RedOrange: _ColorWithComment3Name[42:52],", + (string) (len=60) "\tCustom_prefix_RedOrangeBlue: _ColorWithComment3Name[52:67],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=44) "func (x ColorWithComment3) String() string {", + (string) (len=45) "\tif str, ok := _ColorWithComment3Map[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=47) "\treturn fmt.Sprintf(\"ColorWithComment3(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=59) "var _ColorWithComment3Value = map[string]ColorWithComment3{", + (string) (len=69) "\t_ColorWithComment3Name[0:5]: Custom_prefix_Black,", + (string) (len=69) "\tstrings.ToLower(_ColorWithComment3Name[0:5]): Custom_prefix_Black,", + (string) (len=69) "\t_ColorWithComment3Name[5:10]: Custom_prefix_White,", + (string) (len=69) "\tstrings.ToLower(_ColorWithComment3Name[5:10]): Custom_prefix_White,", + (string) (len=67) "\t_ColorWithComment3Name[10:13]: Custom_prefix_Red,", + (string) (len=67) "\tstrings.ToLower(_ColorWithComment3Name[10:13]): Custom_prefix_Red,", + (string) (len=69) "\t_ColorWithComment3Name[13:18]: Custom_prefix_Green,", + (string) (len=69) "\tstrings.ToLower(_ColorWithComment3Name[13:18]): Custom_prefix_Green,", + (string) (len=68) "\t_ColorWithComment3Name[18:22]: Custom_prefix_Blue,", + (string) (len=68) "\tstrings.ToLower(_ColorWithComment3Name[18:22]): Custom_prefix_Blue,", + (string) (len=68) "\t_ColorWithComment3Name[22:26]: Custom_prefix_Grey,", + (string) (len=68) "\tstrings.ToLower(_ColorWithComment3Name[22:26]): Custom_prefix_Grey,", + (string) (len=70) "\t_ColorWithComment3Name[26:32]: Custom_prefix_Yellow,", + (string) (len=70) "\tstrings.ToLower(_ColorWithComment3Name[26:32]): Custom_prefix_Yellow,", + (string) (len=73) "\t_ColorWithComment3Name[32:42]: Custom_prefix_BlueGreen,", + (string) (len=73) "\tstrings.ToLower(_ColorWithComment3Name[32:42]): Custom_prefix_BlueGreen,", + (string) (len=73) "\t_ColorWithComment3Name[42:52]: Custom_prefix_RedOrange,", + (string) (len=73) "\tstrings.ToLower(_ColorWithComment3Name[42:52]): Custom_prefix_RedOrange,", + (string) (len=77) "\t_ColorWithComment3Name[52:67]: Custom_prefix_RedOrangeBlue,", + (string) (len=77) "\tstrings.ToLower(_ColorWithComment3Name[52:67]): Custom_prefix_RedOrangeBlue,", + (string) (len=1) "}", + (string) "", + (string) (len=78) "// ParseColorWithComment3 attempts to convert a string to a ColorWithComment3.", + (string) (len=69) "func ParseColorWithComment3(name string) (ColorWithComment3, error) {", + (string) (len=48) "\tif x, ok := _ColorWithComment3Value[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=85) "\treturn ColorWithComment3(0), fmt.Errorf(\"%s is not a valid ColorWithComment3\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "func (x ColorWithComment3) Ptr() *ColorWithComment3 {", + (string) (len=10) "\treturn &x", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=58) "func (x ColorWithComment3) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=62) "func (x *ColorWithComment3) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=41) "\ttmp, err := ParseColorWithComment3(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=104) "var _ColorWithComment3ErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=65) "func (x *ColorWithComment3) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=27) "\t\t*x = ColorWithComment3(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=27) "\t\t*x = ColorWithComment3(v)", + (string) (len=13) "\tcase string:", + (string) (len=37) "\t\t*x, err = ParseColorWithComment3(v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {", + (string) (len=41) "\t\t\t\t*x, err = ColorWithComment3(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase []byte:", + (string) (len=45) "\t\t*x, err = ParseColorWithComment3(string(v))", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {", + (string) (len=41) "\t\t\t\t*x, err = ColorWithComment3(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=24) "\tcase ColorWithComment3:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=27) "\t\t*x = ColorWithComment3(v)", + (string) (len=25) "\tcase *ColorWithComment3:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=27) "\t\t*x = ColorWithComment3(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=27) "\t\t*x = ColorWithComment3(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment3(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment3(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=27) "\t\t*x = ColorWithComment3(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment3(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment3(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment3(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=38) "\t\t*x, err = ParseColorWithComment3(*v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {", + (string) (len=41) "\t\t\t\t*x, err = ColorWithComment3(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=58) "func (x ColorWithComment3) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=51) "func (x *ColorWithComment3) Set(val string) error {", + (string) (len=38) "\tv, err := ParseColorWithComment3(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=47) "func (x *ColorWithComment3) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=43) "func (x *ColorWithComment3) Type() string {", + (string) (len=27) "\treturn \"ColorWithComment3\"", + (string) (len=1) "}", + (string) "", + (string) (len=35) "type NullColorWithComment3 struct {", + (string) (len=36) "\tColorWithComment3 ColorWithComment3", + (string) (len=23) "\tValid bool", + (string) (len=23) "\tSet bool", + (string) (len=1) "}", + (string) "", + (string) (len=74) "func NewNullColorWithComment3(val interface{}) (x NullColorWithComment3) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=69) "func (x *NullColorWithComment3) Scan(value interface{}) (err error) {", + (string) (len=13) "\tx.Set = true", + (string) (len=18) "\tif value == nil {", + (string) (len=60) "\t\tx.ColorWithComment3, x.Valid = ColorWithComment3(0), false", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=38) "\terr = x.ColorWithComment3.Scan(value)", + (string) (len=23) "\tx.Valid = (err == nil)", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=62) "func (x NullColorWithComment3) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=46) "\t// driver.Value accepts int64 for int values.", + (string) (len=39) "\treturn int64(x.ColorWithComment3), nil", + (string) (len=1) "}", + (string) "", + (string) (len=68) "// MarshalJSON correctly serializes a NullColorWithComment3 to JSON.", + (string) (len=62) "func (n NullColorWithComment3) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=42) "\t\treturn json.Marshal(n.ColorWithComment3)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=74) "// UnmarshalJSON correctly deserializes a NullColorWithComment3 from JSON.", + (string) (len=63) "func (n *NullColorWithComment3) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=38) "type NullColorWithComment3Str struct {", + (string) (len=22) "\tNullColorWithComment3", + (string) (len=1) "}", + (string) "", + (string) (len=80) "func NewNullColorWithComment3Str(val interface{}) (x NullColorWithComment3Str) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=65) "func (x NullColorWithComment3Str) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=41) "\treturn x.ColorWithComment3.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=68) "// MarshalJSON correctly serializes a NullColorWithComment3 to JSON.", + (string) (len=65) "func (n NullColorWithComment3Str) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=42) "\t\treturn json.Marshal(n.ColorWithComment3)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=74) "// UnmarshalJSON correctly deserializes a NullColorWithComment3 from JSON.", + (string) (len=66) "func (n *NullColorWithComment3Str) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=18) "\t// Skipped value.", + (string) (len=15) "\t// Placeholder", + (string) (len=27) "\t_ ColorWithComment4 = iota", + (string) (len=61) "\t// Custom_prefix_Black is a ColorWithComment4 of type Black.", + (string) (len=20) "\tCustom_prefix_Black", + (string) (len=61) "\t// Custom_prefix_White is a ColorWithComment4 of type White.", + (string) (len=20) "\tCustom_prefix_White", + (string) (len=57) "\t// Custom_prefix_Red is a ColorWithComment4 of type Red.", + (string) (len=18) "\tCustom_prefix_Red", + (string) (len=61) "\t// Custom_prefix_Green is a ColorWithComment4 of type Green.", + (string) (len=24) "\t// Green starts with 33", + (string) (len=50) "\tCustom_prefix_Green ColorWithComment4 = iota + 29", + (string) (len=59) "\t// Custom_prefix_Blue is a ColorWithComment4 of type Blue.", + (string) (len=19) "\tCustom_prefix_Blue", + (string) (len=59) "\t// Custom_prefix_Grey is a ColorWithComment4 of type Grey.", + (string) (len=19) "\tCustom_prefix_Grey", + (string) (len=63) "\t// Custom_prefix_Yellow is a ColorWithComment4 of type Yellow.", + (string) (len=110) "\t// Where did all the (somewhat) bad fish go? (something else that goes in parentheses at the end of the line)", + (string) (len=21) "\tCustom_prefix_Yellow", + (string) (len=70) "\t// Custom_prefix_BlueGreen is a ColorWithComment4 of type Blue-Green.", + (string) (len=22) "\t// blue-green comment", + (string) (len=24) "\tCustom_prefix_BlueGreen", + (string) (len=70) "\t// Custom_prefix_RedOrange is a ColorWithComment4 of type Red-Orange.", + (string) (len=20) "\t// has a , in it!?!", + (string) (len=24) "\tCustom_prefix_RedOrange", + (string) (len=1) ")", + (string) "", + (string) (len=85) "const _ColorWithComment4Name = \"BlackWhiteRedGreenBluegreyyellowblue-greenred-orange\"", + (string) "", + (string) (len=57) "var _ColorWithComment4Map = map[ColorWithComment4]string{", + (string) (len=54) "\tCustom_prefix_Black: _ColorWithComment4Name[0:5],", + (string) (len=55) "\tCustom_prefix_White: _ColorWithComment4Name[5:10],", + (string) (len=56) "\tCustom_prefix_Red: _ColorWithComment4Name[10:13],", + (string) (len=56) "\tCustom_prefix_Green: _ColorWithComment4Name[13:18],", + (string) (len=56) "\tCustom_prefix_Blue: _ColorWithComment4Name[18:22],", + (string) (len=56) "\tCustom_prefix_Grey: _ColorWithComment4Name[22:26],", + (string) (len=56) "\tCustom_prefix_Yellow: _ColorWithComment4Name[26:32],", + (string) (len=56) "\tCustom_prefix_BlueGreen: _ColorWithComment4Name[32:42],", + (string) (len=56) "\tCustom_prefix_RedOrange: _ColorWithComment4Name[42:52],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=44) "func (x ColorWithComment4) String() string {", + (string) (len=45) "\tif str, ok := _ColorWithComment4Map[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=47) "\treturn fmt.Sprintf(\"ColorWithComment4(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=59) "var _ColorWithComment4Value = map[string]ColorWithComment4{", + (string) (len=69) "\t_ColorWithComment4Name[0:5]: Custom_prefix_Black,", + (string) (len=69) "\tstrings.ToLower(_ColorWithComment4Name[0:5]): Custom_prefix_Black,", + (string) (len=69) "\t_ColorWithComment4Name[5:10]: Custom_prefix_White,", + (string) (len=69) "\tstrings.ToLower(_ColorWithComment4Name[5:10]): Custom_prefix_White,", + (string) (len=67) "\t_ColorWithComment4Name[10:13]: Custom_prefix_Red,", + (string) (len=67) "\tstrings.ToLower(_ColorWithComment4Name[10:13]): Custom_prefix_Red,", + (string) (len=69) "\t_ColorWithComment4Name[13:18]: Custom_prefix_Green,", + (string) (len=69) "\tstrings.ToLower(_ColorWithComment4Name[13:18]): Custom_prefix_Green,", + (string) (len=68) "\t_ColorWithComment4Name[18:22]: Custom_prefix_Blue,", + (string) (len=68) "\tstrings.ToLower(_ColorWithComment4Name[18:22]): Custom_prefix_Blue,", + (string) (len=68) "\t_ColorWithComment4Name[22:26]: Custom_prefix_Grey,", + (string) (len=68) "\tstrings.ToLower(_ColorWithComment4Name[22:26]): Custom_prefix_Grey,", + (string) (len=70) "\t_ColorWithComment4Name[26:32]: Custom_prefix_Yellow,", + (string) (len=70) "\tstrings.ToLower(_ColorWithComment4Name[26:32]): Custom_prefix_Yellow,", + (string) (len=73) "\t_ColorWithComment4Name[32:42]: Custom_prefix_BlueGreen,", + (string) (len=73) "\tstrings.ToLower(_ColorWithComment4Name[32:42]): Custom_prefix_BlueGreen,", + (string) (len=73) "\t_ColorWithComment4Name[42:52]: Custom_prefix_RedOrange,", + (string) (len=73) "\tstrings.ToLower(_ColorWithComment4Name[42:52]): Custom_prefix_RedOrange,", + (string) (len=1) "}", + (string) "", + (string) (len=78) "// ParseColorWithComment4 attempts to convert a string to a ColorWithComment4.", + (string) (len=69) "func ParseColorWithComment4(name string) (ColorWithComment4, error) {", + (string) (len=48) "\tif x, ok := _ColorWithComment4Value[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=85) "\treturn ColorWithComment4(0), fmt.Errorf(\"%s is not a valid ColorWithComment4\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "func (x ColorWithComment4) Ptr() *ColorWithComment4 {", + (string) (len=10) "\treturn &x", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=58) "func (x ColorWithComment4) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=62) "func (x *ColorWithComment4) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=41) "\ttmp, err := ParseColorWithComment4(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=104) "var _ColorWithComment4ErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=65) "func (x *ColorWithComment4) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=27) "\t\t*x = ColorWithComment4(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=27) "\t\t*x = ColorWithComment4(v)", + (string) (len=13) "\tcase string:", + (string) (len=37) "\t\t*x, err = ParseColorWithComment4(v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {", + (string) (len=41) "\t\t\t\t*x, err = ColorWithComment4(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase []byte:", + (string) (len=45) "\t\t*x, err = ParseColorWithComment4(string(v))", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {", + (string) (len=41) "\t\t\t\t*x, err = ColorWithComment4(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=24) "\tcase ColorWithComment4:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=27) "\t\t*x = ColorWithComment4(v)", + (string) (len=25) "\tcase *ColorWithComment4:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=27) "\t\t*x = ColorWithComment4(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=27) "\t\t*x = ColorWithComment4(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment4(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment4(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=27) "\t\t*x = ColorWithComment4(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment4(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment4(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment4(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=38) "\t\t*x, err = ParseColorWithComment4(*v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {", + (string) (len=41) "\t\t\t\t*x, err = ColorWithComment4(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=58) "func (x ColorWithComment4) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=51) "func (x *ColorWithComment4) Set(val string) error {", + (string) (len=38) "\tv, err := ParseColorWithComment4(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=47) "func (x *ColorWithComment4) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=43) "func (x *ColorWithComment4) Type() string {", + (string) (len=27) "\treturn \"ColorWithComment4\"", + (string) (len=1) "}", + (string) "", + (string) (len=35) "type NullColorWithComment4 struct {", + (string) (len=36) "\tColorWithComment4 ColorWithComment4", + (string) (len=23) "\tValid bool", + (string) (len=23) "\tSet bool", + (string) (len=1) "}", + (string) "", + (string) (len=74) "func NewNullColorWithComment4(val interface{}) (x NullColorWithComment4) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=69) "func (x *NullColorWithComment4) Scan(value interface{}) (err error) {", + (string) (len=13) "\tx.Set = true", + (string) (len=18) "\tif value == nil {", + (string) (len=60) "\t\tx.ColorWithComment4, x.Valid = ColorWithComment4(0), false", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=38) "\terr = x.ColorWithComment4.Scan(value)", + (string) (len=23) "\tx.Valid = (err == nil)", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=62) "func (x NullColorWithComment4) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=46) "\t// driver.Value accepts int64 for int values.", + (string) (len=39) "\treturn int64(x.ColorWithComment4), nil", + (string) (len=1) "}", + (string) "", + (string) (len=68) "// MarshalJSON correctly serializes a NullColorWithComment4 to JSON.", + (string) (len=62) "func (n NullColorWithComment4) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=42) "\t\treturn json.Marshal(n.ColorWithComment4)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=74) "// UnmarshalJSON correctly deserializes a NullColorWithComment4 from JSON.", + (string) (len=63) "func (n *NullColorWithComment4) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=38) "type NullColorWithComment4Str struct {", + (string) (len=22) "\tNullColorWithComment4", + (string) (len=1) "}", + (string) "", + (string) (len=80) "func NewNullColorWithComment4Str(val interface{}) (x NullColorWithComment4Str) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=65) "func (x NullColorWithComment4Str) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=41) "\treturn x.ColorWithComment4.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=68) "// MarshalJSON correctly serializes a NullColorWithComment4 to JSON.", + (string) (len=65) "func (n NullColorWithComment4Str) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=42) "\t\treturn json.Marshal(n.ColorWithComment4)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=74) "// UnmarshalJSON correctly deserializes a NullColorWithComment4 from JSON.", + (string) (len=66) "func (n *NullColorWithComment4Str) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=57) "\t// Custom_prefix_Unknown is a Enum64bit of type Unknown.", + (string) (len=39) "\tCustom_prefix_Unknown Enum64bit = iota", + (string) (len=53) "\t// Custom_prefix_E2P15 is a Enum64bit of type E2P15.", + (string) (len=45) "\tCustom_prefix_E2P15 Enum64bit = iota + 32767", + (string) (len=53) "\t// Custom_prefix_E2P16 is a Enum64bit of type E2P16.", + (string) (len=45) "\tCustom_prefix_E2P16 Enum64bit = iota + 65534", + (string) (len=53) "\t// Custom_prefix_E2P17 is a Enum64bit of type E2P17.", + (string) (len=46) "\tCustom_prefix_E2P17 Enum64bit = iota + 131069", + (string) (len=53) "\t// Custom_prefix_E2P18 is a Enum64bit of type E2P18.", + (string) (len=46) "\tCustom_prefix_E2P18 Enum64bit = iota + 262140", + (string) (len=53) "\t// Custom_prefix_E2P19 is a Enum64bit of type E2P19.", + (string) (len=46) "\tCustom_prefix_E2P19 Enum64bit = iota + 524283", + (string) (len=53) "\t// Custom_prefix_E2P20 is a Enum64bit of type E2P20.", + (string) (len=47) "\tCustom_prefix_E2P20 Enum64bit = iota + 1048570", + (string) (len=53) "\t// Custom_prefix_E2P21 is a Enum64bit of type E2P21.", + (string) (len=47) "\tCustom_prefix_E2P21 Enum64bit = iota + 2097145", + (string) (len=53) "\t// Custom_prefix_E2P22 is a Enum64bit of type E2P22.", + (string) (len=48) "\tCustom_prefix_E2P22 Enum64bit = iota + 33554424", + (string) (len=53) "\t// Custom_prefix_E2P23 is a Enum64bit of type E2P23.", + (string) (len=48) "\tCustom_prefix_E2P23 Enum64bit = iota + 67108855", + (string) (len=53) "\t// Custom_prefix_E2P28 is a Enum64bit of type E2P28.", + (string) (len=49) "\tCustom_prefix_E2P28 Enum64bit = iota + 536870902", + (string) (len=53) "\t// Custom_prefix_E2P30 is a Enum64bit of type E2P30.", + (string) (len=50) "\tCustom_prefix_E2P30 Enum64bit = iota + 1073741813", + (string) (len=53) "\t// Custom_prefix_E2P31 is a Enum64bit of type E2P31.", + (string) (len=50) "\tCustom_prefix_E2P31 Enum64bit = iota + 2147483636", + (string) (len=53) "\t// Custom_prefix_E2P32 is a Enum64bit of type E2P32.", + (string) (len=50) "\tCustom_prefix_E2P32 Enum64bit = iota + 4294967283", + (string) (len=53) "\t// Custom_prefix_E2P33 is a Enum64bit of type E2P33.", + (string) (len=50) "\tCustom_prefix_E2P33 Enum64bit = iota + 8454967282", + (string) (len=1) ")", + (string) "", + (string) (len=102) "const _Enum64bitName = \"UnknownE2P15E2P16E2P17E2P18E2P19E2P20E2P21E2P22E2P23E2P28E2P30E2P31E2P32E2P33\"", + (string) "", + (string) (len=41) "var _Enum64bitMap = map[Enum64bit]string{", + (string) (len=44) "\tCustom_prefix_Unknown: _Enum64bitName[0:7],", + (string) (len=45) "\tCustom_prefix_E2P15: _Enum64bitName[7:12],", + (string) (len=46) "\tCustom_prefix_E2P16: _Enum64bitName[12:17],", + (string) (len=46) "\tCustom_prefix_E2P17: _Enum64bitName[17:22],", + (string) (len=46) "\tCustom_prefix_E2P18: _Enum64bitName[22:27],", + (string) (len=46) "\tCustom_prefix_E2P19: _Enum64bitName[27:32],", + (string) (len=46) "\tCustom_prefix_E2P20: _Enum64bitName[32:37],", + (string) (len=46) "\tCustom_prefix_E2P21: _Enum64bitName[37:42],", + (string) (len=46) "\tCustom_prefix_E2P22: _Enum64bitName[42:47],", + (string) (len=46) "\tCustom_prefix_E2P23: _Enum64bitName[47:52],", + (string) (len=46) "\tCustom_prefix_E2P28: _Enum64bitName[52:57],", + (string) (len=46) "\tCustom_prefix_E2P30: _Enum64bitName[57:62],", + (string) (len=46) "\tCustom_prefix_E2P31: _Enum64bitName[62:67],", + (string) (len=46) "\tCustom_prefix_E2P32: _Enum64bitName[67:72],", + (string) (len=46) "\tCustom_prefix_E2P33: _Enum64bitName[72:77],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=36) "func (x Enum64bit) String() string {", + (string) (len=37) "\tif str, ok := _Enum64bitMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=39) "\treturn fmt.Sprintf(\"Enum64bit(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=43) "var _Enum64bitValue = map[string]Enum64bit{", + (string) (len=63) "\t_Enum64bitName[0:7]: Custom_prefix_Unknown,", + (string) (len=63) "\tstrings.ToLower(_Enum64bitName[0:7]): Custom_prefix_Unknown,", + (string) (len=61) "\t_Enum64bitName[7:12]: Custom_prefix_E2P15,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[7:12]): Custom_prefix_E2P15,", + (string) (len=61) "\t_Enum64bitName[12:17]: Custom_prefix_E2P16,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[12:17]): Custom_prefix_E2P16,", + (string) (len=61) "\t_Enum64bitName[17:22]: Custom_prefix_E2P17,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[17:22]): Custom_prefix_E2P17,", + (string) (len=61) "\t_Enum64bitName[22:27]: Custom_prefix_E2P18,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[22:27]): Custom_prefix_E2P18,", + (string) (len=61) "\t_Enum64bitName[27:32]: Custom_prefix_E2P19,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[27:32]): Custom_prefix_E2P19,", + (string) (len=61) "\t_Enum64bitName[32:37]: Custom_prefix_E2P20,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[32:37]): Custom_prefix_E2P20,", + (string) (len=61) "\t_Enum64bitName[37:42]: Custom_prefix_E2P21,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[37:42]): Custom_prefix_E2P21,", + (string) (len=61) "\t_Enum64bitName[42:47]: Custom_prefix_E2P22,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[42:47]): Custom_prefix_E2P22,", + (string) (len=61) "\t_Enum64bitName[47:52]: Custom_prefix_E2P23,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[47:52]): Custom_prefix_E2P23,", + (string) (len=61) "\t_Enum64bitName[52:57]: Custom_prefix_E2P28,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[52:57]): Custom_prefix_E2P28,", + (string) (len=61) "\t_Enum64bitName[57:62]: Custom_prefix_E2P30,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[57:62]): Custom_prefix_E2P30,", + (string) (len=61) "\t_Enum64bitName[62:67]: Custom_prefix_E2P31,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[62:67]): Custom_prefix_E2P31,", + (string) (len=61) "\t_Enum64bitName[67:72]: Custom_prefix_E2P32,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[67:72]): Custom_prefix_E2P32,", + (string) (len=61) "\t_Enum64bitName[72:77]: Custom_prefix_E2P33,", + (string) (len=61) "\tstrings.ToLower(_Enum64bitName[72:77]): Custom_prefix_E2P33,", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// ParseEnum64bit attempts to convert a string to a Enum64bit.", + (string) (len=53) "func ParseEnum64bit(name string) (Enum64bit, error) {", + (string) (len=40) "\tif x, ok := _Enum64bitValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=69) "\treturn Enum64bit(0), fmt.Errorf(\"%s is not a valid Enum64bit\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=37) "func (x Enum64bit) Ptr() *Enum64bit {", + (string) (len=10) "\treturn &x", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=50) "func (x Enum64bit) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=54) "func (x *Enum64bit) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=33) "\ttmp, err := ParseEnum64bit(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=96) "var _Enum64bitErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=57) "func (x *Enum64bit) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=19) "\t\t*x = Enum64bit(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=19) "\t\t*x = Enum64bit(v)", + (string) (len=13) "\tcase string:", + (string) (len=29) "\t\t*x, err = ParseEnum64bit(v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {", + (string) (len=33) "\t\t\t\t*x, err = Enum64bit(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase []byte:", + (string) (len=37) "\t\t*x, err = ParseEnum64bit(string(v))", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {", + (string) (len=33) "\t\t\t\t*x, err = Enum64bit(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=16) "\tcase Enum64bit:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=19) "\t\t*x = Enum64bit(v)", + (string) (len=17) "\tcase *Enum64bit:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=19) "\t\t*x = Enum64bit(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=19) "\t\t*x = Enum64bit(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=20) "\t\t*x = Enum64bit(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=20) "\t\t*x = Enum64bit(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=19) "\t\t*x = Enum64bit(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=20) "\t\t*x = Enum64bit(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=20) "\t\t*x = Enum64bit(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=20) "\t\t*x = Enum64bit(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=30) "\t\t*x, err = ParseEnum64bit(*v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {", + (string) (len=33) "\t\t\t\t*x, err = Enum64bit(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=50) "func (x Enum64bit) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=43) "func (x *Enum64bit) Set(val string) error {", + (string) (len=30) "\tv, err := ParseEnum64bit(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=39) "func (x *Enum64bit) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=35) "func (x *Enum64bit) Type() string {", + (string) (len=19) "\treturn \"Enum64bit\"", + (string) (len=1) "}", + (string) "", + (string) (len=27) "type NullEnum64bit struct {", + (string) (len=20) "\tEnum64bit Enum64bit", + (string) (len=15) "\tValid bool", + (string) (len=15) "\tSet bool", + (string) (len=1) "}", + (string) "", + (string) (len=58) "func NewNullEnum64bit(val interface{}) (x NullEnum64bit) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=61) "func (x *NullEnum64bit) Scan(value interface{}) (err error) {", + (string) (len=13) "\tx.Set = true", + (string) (len=18) "\tif value == nil {", + (string) (len=44) "\t\tx.Enum64bit, x.Valid = Enum64bit(0), false", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=30) "\terr = x.Enum64bit.Scan(value)", + (string) (len=23) "\tx.Valid = (err == nil)", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=54) "func (x NullEnum64bit) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=46) "\t// driver.Value accepts int64 for int values.", + (string) (len=31) "\treturn int64(x.Enum64bit), nil", + (string) (len=1) "}", + (string) "", + (string) (len=60) "// MarshalJSON correctly serializes a NullEnum64bit to JSON.", + (string) (len=54) "func (n NullEnum64bit) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=34) "\t\treturn json.Marshal(n.Enum64bit)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=66) "// UnmarshalJSON correctly deserializes a NullEnum64bit from JSON.", + (string) (len=55) "func (n *NullEnum64bit) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=30) "type NullEnum64bitStr struct {", + (string) (len=14) "\tNullEnum64bit", + (string) (len=1) "}", + (string) "", + (string) (len=64) "func NewNullEnum64bitStr(val interface{}) (x NullEnum64bitStr) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=57) "func (x NullEnum64bitStr) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=33) "\treturn x.Enum64bit.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=60) "// MarshalJSON correctly serializes a NullEnum64bit to JSON.", + (string) (len=57) "func (n NullEnum64bitStr) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=34) "\t\treturn json.Marshal(n.Enum64bit)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=66) "// UnmarshalJSON correctly deserializes a NullEnum64bit from JSON.", + (string) (len=58) "func (n *NullEnum64bitStr) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=51) "\t// Custom_prefix_Toyota is a Model of type Toyota.", + (string) (len=34) "\tCustom_prefix_Toyota Model = iota", + (string) (len=18) "\t// Skipped value.", + (string) (len=2) "\t_", + (string) (len=49) "\t// Custom_prefix_Chevy is a Model of type Chevy.", + (string) (len=20) "\tCustom_prefix_Chevy", + (string) (len=18) "\t// Skipped value.", + (string) (len=2) "\t_", + (string) (len=47) "\t// Custom_prefix_Ford is a Model of type Ford.", + (string) (len=19) "\tCustom_prefix_Ford", + (string) (len=1) ")", + (string) "", + (string) (len=36) "const _ModelName = \"ToyotaChevyFord\"", + (string) "", + (string) (len=33) "var _ModelMap = map[Model]string{", + (string) (len=39) "\tCustom_prefix_Toyota: _ModelName[0:6],", + (string) (len=40) "\tCustom_prefix_Chevy: _ModelName[6:11],", + (string) (len=41) "\tCustom_prefix_Ford: _ModelName[11:15],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=32) "func (x Model) String() string {", + (string) (len=33) "\tif str, ok := _ModelMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=35) "\treturn fmt.Sprintf(\"Model(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=35) "var _ModelValue = map[string]Model{", + (string) (len=58) "\t_ModelName[0:6]: Custom_prefix_Toyota,", + (string) (len=58) "\tstrings.ToLower(_ModelName[0:6]): Custom_prefix_Toyota,", + (string) (len=57) "\t_ModelName[6:11]: Custom_prefix_Chevy,", + (string) (len=57) "\tstrings.ToLower(_ModelName[6:11]): Custom_prefix_Chevy,", + (string) (len=56) "\t_ModelName[11:15]: Custom_prefix_Ford,", + (string) (len=56) "\tstrings.ToLower(_ModelName[11:15]): Custom_prefix_Ford,", + (string) (len=1) "}", + (string) "", + (string) (len=54) "// ParseModel attempts to convert a string to a Model.", + (string) (len=45) "func ParseModel(name string) (Model, error) {", + (string) (len=36) "\tif x, ok := _ModelValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=61) "\treturn Model(0), fmt.Errorf(\"%s is not a valid Model\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=29) "func (x Model) Ptr() *Model {", + (string) (len=10) "\treturn &x", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=46) "func (x Model) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=50) "func (x *Model) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=29) "\ttmp, err := ParseModel(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=92) "var _ModelErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=53) "func (x *Model) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=15) "\t\t*x = Model(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=15) "\t\t*x = Model(v)", + (string) (len=13) "\tcase string:", + (string) (len=25) "\t\t*x, err = ParseModel(v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {", + (string) (len=29) "\t\t\t\t*x, err = Model(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase []byte:", + (string) (len=33) "\t\t*x, err = ParseModel(string(v))", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {", + (string) (len=29) "\t\t\t\t*x, err = Model(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=12) "\tcase Model:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=15) "\t\t*x = Model(v)", + (string) (len=13) "\tcase *Model:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=15) "\t\t*x = Model(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=15) "\t\t*x = Model(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Model(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Model(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\t*x = Model(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Model(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Model(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Model(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=26) "\t\t*x, err = ParseModel(*v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {", + (string) (len=29) "\t\t\t\t*x, err = Model(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=46) "func (x Model) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=39) "func (x *Model) Set(val string) error {", + (string) (len=26) "\tv, err := ParseModel(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=35) "func (x *Model) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=31) "func (x *Model) Type() string {", + (string) (len=15) "\treturn \"Model\"", + (string) (len=1) "}", + (string) "", + (string) (len=23) "type NullModel struct {", + (string) (len=12) "\tModel Model", + (string) (len=11) "\tValid bool", + (string) (len=11) "\tSet bool", + (string) (len=1) "}", + (string) "", + (string) (len=50) "func NewNullModel(val interface{}) (x NullModel) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=57) "func (x *NullModel) Scan(value interface{}) (err error) {", + (string) (len=13) "\tx.Set = true", + (string) (len=18) "\tif value == nil {", + (string) (len=36) "\t\tx.Model, x.Valid = Model(0), false", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=26) "\terr = x.Model.Scan(value)", + (string) (len=23) "\tx.Valid = (err == nil)", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=50) "func (x NullModel) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=46) "\t// driver.Value accepts int64 for int values.", + (string) (len=27) "\treturn int64(x.Model), nil", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// MarshalJSON correctly serializes a NullModel to JSON.", + (string) (len=50) "func (n NullModel) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=30) "\t\treturn json.Marshal(n.Model)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// UnmarshalJSON correctly deserializes a NullModel from JSON.", + (string) (len=51) "func (n *NullModel) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=26) "type NullModelStr struct {", + (string) (len=10) "\tNullModel", + (string) (len=1) "}", + (string) "", + (string) (len=56) "func NewNullModelStr(val interface{}) (x NullModelStr) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=53) "func (x NullModelStr) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=29) "\treturn x.Model.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// MarshalJSON correctly serializes a NullModel to JSON.", + (string) (len=53) "func (n NullModelStr) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=30) "\t\treturn json.Marshal(n.Model)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// UnmarshalJSON correctly deserializes a NullModel from JSON.", + (string) (len=54) "func (n *NullModelStr) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=65) "\t// Custom_prefix_TestHyphen is a Sanitizing of type Test-Hyphen.", + (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=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-.", + (string) (len=27) "\tCustom_prefix_EndingHyphen", + (string) (len=1) ")", + (string) "", + (string) (len=112) "const _SanitizingName = \"test-Hyphen-hyphenStart_underscoreFirst0numberFirst123456789a123123-asdfending-hyphen-\"", + (string) "", + (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_123123Asdf: _SanitizingName[61:72],", + (string) (len=56) "\tCustom_prefix_EndingHyphen: _SanitizingName[72:86],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=37) "func (x Sanitizing) String() string {", + (string) (len=38) "\tif str, ok := _SanitizingMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=40) "\treturn fmt.Sprintf(\"Sanitizing(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=45) "var _SanitizingValue = map[string]Sanitizing{", + (string) (len=67) "\t_SanitizingName[0:11]: Custom_prefix_TestHyphen,", + (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=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,", + (string) (len=69) "\tstrings.ToLower(_SanitizingName[72:86]): Custom_prefix_EndingHyphen,", + (string) (len=1) "}", + (string) "", + (string) (len=64) "// ParseSanitizing attempts to convert a string to a Sanitizing.", + (string) (len=55) "func ParseSanitizing(name string) (Sanitizing, error) {", + (string) (len=41) "\tif x, ok := _SanitizingValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=71) "\treturn Sanitizing(0), fmt.Errorf(\"%s is not a valid Sanitizing\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=39) "func (x Sanitizing) Ptr() *Sanitizing {", + (string) (len=10) "\treturn &x", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=51) "func (x Sanitizing) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=55) "func (x *Sanitizing) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=34) "\ttmp, err := ParseSanitizing(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=97) "var _SanitizingErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=58) "func (x *Sanitizing) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=20) "\t\t*x = Sanitizing(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=20) "\t\t*x = Sanitizing(v)", + (string) (len=13) "\tcase string:", + (string) (len=30) "\t\t*x, err = ParseSanitizing(v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {", + (string) (len=34) "\t\t\t\t*x, err = Sanitizing(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase []byte:", + (string) (len=38) "\t\t*x, err = ParseSanitizing(string(v))", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {", + (string) (len=34) "\t\t\t\t*x, err = Sanitizing(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=17) "\tcase Sanitizing:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=20) "\t\t*x = Sanitizing(v)", + (string) (len=18) "\tcase *Sanitizing:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=20) "\t\t*x = Sanitizing(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=20) "\t\t*x = Sanitizing(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = Sanitizing(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = Sanitizing(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=20) "\t\t*x = Sanitizing(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = Sanitizing(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = Sanitizing(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = Sanitizing(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=31) "\t\t*x, err = ParseSanitizing(*v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {", + (string) (len=34) "\t\t\t\t*x, err = Sanitizing(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=51) "func (x Sanitizing) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=44) "func (x *Sanitizing) Set(val string) error {", + (string) (len=31) "\tv, err := ParseSanitizing(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=40) "func (x *Sanitizing) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=36) "func (x *Sanitizing) Type() string {", + (string) (len=20) "\treturn \"Sanitizing\"", + (string) (len=1) "}", + (string) "", + (string) (len=28) "type NullSanitizing struct {", + (string) (len=22) "\tSanitizing Sanitizing", + (string) (len=16) "\tValid bool", + (string) (len=16) "\tSet bool", + (string) (len=1) "}", + (string) "", + (string) (len=60) "func NewNullSanitizing(val interface{}) (x NullSanitizing) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=62) "func (x *NullSanitizing) Scan(value interface{}) (err error) {", + (string) (len=13) "\tx.Set = true", + (string) (len=18) "\tif value == nil {", + (string) (len=46) "\t\tx.Sanitizing, x.Valid = Sanitizing(0), false", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=31) "\terr = x.Sanitizing.Scan(value)", + (string) (len=23) "\tx.Valid = (err == nil)", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=55) "func (x NullSanitizing) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=46) "\t// driver.Value accepts int64 for int values.", + (string) (len=32) "\treturn int64(x.Sanitizing), nil", + (string) (len=1) "}", + (string) "", + (string) (len=61) "// MarshalJSON correctly serializes a NullSanitizing to JSON.", + (string) (len=55) "func (n NullSanitizing) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=35) "\t\treturn json.Marshal(n.Sanitizing)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=67) "// UnmarshalJSON correctly deserializes a NullSanitizing from JSON.", + (string) (len=56) "func (n *NullSanitizing) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=31) "type NullSanitizingStr struct {", + (string) (len=15) "\tNullSanitizing", + (string) (len=1) "}", + (string) "", + (string) (len=66) "func NewNullSanitizingStr(val interface{}) (x NullSanitizingStr) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=58) "func (x NullSanitizingStr) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=34) "\treturn x.Sanitizing.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=61) "// MarshalJSON correctly serializes a NullSanitizing to JSON.", + (string) (len=58) "func (n NullSanitizingStr) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=35) "\t\treturn json.Marshal(n.Sanitizing)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=67) "// UnmarshalJSON correctly deserializes a NullSanitizing from JSON.", + (string) (len=59) "func (n *NullSanitizingStr) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=46) "\t// Custom_prefix_Coke is a Soda of type Coke.", + (string) (len=31) "\tCustom_prefix_Coke Soda = iota", + (string) (len=48) "\t// Custom_prefix_Pepsi is a Soda of type Pepsi.", + (string) (len=20) "\tCustom_prefix_Pepsi", + (string) (len=50) "\t// Custom_prefix_MtnDew is a Soda of type MtnDew.", + (string) (len=21) "\tCustom_prefix_MtnDew", + (string) (len=1) ")", + (string) "", + (string) (len=35) "const _SodaName = \"CokePepsiMtnDew\"", + (string) "", + (string) (len=31) "var _SodaMap = map[Soda]string{", + (string) (len=38) "\tCustom_prefix_Coke: _SodaName[0:4],", + (string) (len=38) "\tCustom_prefix_Pepsi: _SodaName[4:9],", + (string) (len=39) "\tCustom_prefix_MtnDew: _SodaName[9:15],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=31) "func (x Soda) String() string {", + (string) (len=32) "\tif str, ok := _SodaMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=34) "\treturn fmt.Sprintf(\"Soda(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=33) "var _SodaValue = map[string]Soda{", + (string) (len=54) "\t_SodaName[0:4]: Custom_prefix_Coke,", + (string) (len=54) "\tstrings.ToLower(_SodaName[0:4]): Custom_prefix_Coke,", + (string) (len=55) "\t_SodaName[4:9]: Custom_prefix_Pepsi,", + (string) (len=55) "\tstrings.ToLower(_SodaName[4:9]): Custom_prefix_Pepsi,", + (string) (len=56) "\t_SodaName[9:15]: Custom_prefix_MtnDew,", + (string) (len=56) "\tstrings.ToLower(_SodaName[9:15]): Custom_prefix_MtnDew,", + (string) (len=1) "}", + (string) "", + (string) (len=52) "// ParseSoda attempts to convert a string to a Soda.", + (string) (len=43) "func ParseSoda(name string) (Soda, error) {", + (string) (len=35) "\tif x, ok := _SodaValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=59) "\treturn Soda(0), fmt.Errorf(\"%s is not a valid Soda\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=27) "func (x Soda) Ptr() *Soda {", + (string) (len=10) "\treturn &x", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=45) "func (x Soda) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=49) "func (x *Soda) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=28) "\ttmp, err := ParseSoda(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=91) "var _SodaErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=52) "func (x *Soda) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=14) "\t\t*x = Soda(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=14) "\t\t*x = Soda(v)", + (string) (len=13) "\tcase string:", + (string) (len=24) "\t\t*x, err = ParseSoda(v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {", + (string) (len=28) "\t\t\t\t*x, err = Soda(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase []byte:", + (string) (len=32) "\t\t*x, err = ParseSoda(string(v))", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {", + (string) (len=28) "\t\t\t\t*x, err = Soda(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=11) "\tcase Soda:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=14) "\t\t*x = Soda(v)", + (string) (len=12) "\tcase *Soda:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=14) "\t\t*x = Soda(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=14) "\t\t*x = Soda(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=15) "\t\t*x = Soda(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=15) "\t\t*x = Soda(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=14) "\t\t*x = Soda(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=15) "\t\t*x = Soda(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=15) "\t\t*x = Soda(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=15) "\t\t*x = Soda(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=25) "\t\t*x, err = ParseSoda(*v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {", + (string) (len=28) "\t\t\t\t*x, err = Soda(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=45) "func (x Soda) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=38) "func (x *Soda) Set(val string) error {", + (string) (len=25) "\tv, err := ParseSoda(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=34) "func (x *Soda) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=30) "func (x *Soda) Type() string {", + (string) (len=14) "\treturn \"Soda\"", + (string) (len=1) "}", + (string) "", + (string) (len=22) "type NullSoda struct {", + (string) (len=11) "\tSoda Soda", + (string) (len=11) "\tValid bool", + (string) (len=11) "\tSet bool", + (string) (len=1) "}", + (string) "", + (string) (len=48) "func NewNullSoda(val interface{}) (x NullSoda) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=56) "func (x *NullSoda) Scan(value interface{}) (err error) {", + (string) (len=13) "\tx.Set = true", + (string) (len=18) "\tif value == nil {", + (string) (len=34) "\t\tx.Soda, x.Valid = Soda(0), false", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=25) "\terr = x.Soda.Scan(value)", + (string) (len=23) "\tx.Valid = (err == nil)", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=49) "func (x NullSoda) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=46) "\t// driver.Value accepts int64 for int values.", + (string) (len=26) "\treturn int64(x.Soda), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// MarshalJSON correctly serializes a NullSoda to JSON.", + (string) (len=49) "func (n NullSoda) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=29) "\t\treturn json.Marshal(n.Soda)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=61) "// UnmarshalJSON correctly deserializes a NullSoda from JSON.", + (string) (len=50) "func (n *NullSoda) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=25) "type NullSodaStr struct {", + (string) (len=9) "\tNullSoda", + (string) (len=1) "}", + (string) "", + (string) (len=54) "func NewNullSodaStr(val interface{}) (x NullSodaStr) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=52) "func (x NullSodaStr) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=28) "\treturn x.Soda.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// MarshalJSON correctly serializes a NullSoda to JSON.", + (string) (len=52) "func (n NullSodaStr) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=29) "\t\treturn json.Marshal(n.Soda)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=61) "// UnmarshalJSON correctly deserializes a NullSoda from JSON.", + (string) (len=53) "func (n *NullSodaStr) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=70) "\t// Custom_prefix_StartWithNum is a StartNotZero of type StartWithNum.", + (string) (len=52) "\tCustom_prefix_StartWithNum StartNotZero = iota + 23", + (string) (len=60) "\t// Custom_prefix_NextNum is a StartNotZero of type NextNum.", + (string) (len=22) "\tCustom_prefix_NextNum", + (string) (len=1) ")", + (string) "", + (string) (len=47) "const _StartNotZeroName = \"startWithNumnextNum\"", + (string) "", + (string) (len=47) "var _StartNotZeroMap = map[StartNotZero]string{", + (string) (len=53) "\tCustom_prefix_StartWithNum: _StartNotZeroName[0:12],", + (string) (len=54) "\tCustom_prefix_NextNum: _StartNotZeroName[12:19],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=39) "func (x StartNotZero) String() string {", + (string) (len=40) "\tif str, ok := _StartNotZeroMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=42) "\treturn fmt.Sprintf(\"StartNotZero(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=49) "var _StartNotZeroValue = map[string]StartNotZero{", + (string) (len=71) "\t_StartNotZeroName[0:12]: Custom_prefix_StartWithNum,", + (string) (len=71) "\tstrings.ToLower(_StartNotZeroName[0:12]): Custom_prefix_StartWithNum,", + (string) (len=66) "\t_StartNotZeroName[12:19]: Custom_prefix_NextNum,", + (string) (len=66) "\tstrings.ToLower(_StartNotZeroName[12:19]): Custom_prefix_NextNum,", + (string) (len=1) "}", + (string) "", + (string) (len=68) "// ParseStartNotZero attempts to convert a string to a StartNotZero.", + (string) (len=59) "func ParseStartNotZero(name string) (StartNotZero, error) {", + (string) (len=43) "\tif x, ok := _StartNotZeroValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=75) "\treturn StartNotZero(0), fmt.Errorf(\"%s is not a valid StartNotZero\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=43) "func (x StartNotZero) Ptr() *StartNotZero {", + (string) (len=10) "\treturn &x", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=53) "func (x StartNotZero) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=57) "func (x *StartNotZero) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=36) "\ttmp, err := ParseStartNotZero(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=99) "var _StartNotZeroErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=60) "func (x *StartNotZero) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=22) "\t\t*x = StartNotZero(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=22) "\t\t*x = StartNotZero(v)", + (string) (len=13) "\tcase string:", + (string) (len=32) "\t\t*x, err = ParseStartNotZero(v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=49) "\t\t\tif val, verr := strconv.Atoi(v); verr == nil {", + (string) (len=36) "\t\t\t\t*x, err = StartNotZero(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=13) "\tcase []byte:", + (string) (len=40) "\t\t*x, err = ParseStartNotZero(string(v))", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=57) "\t\t\tif val, verr := strconv.Atoi(string(v)); verr == nil {", + (string) (len=36) "\t\t\t\t*x, err = StartNotZero(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=19) "\tcase StartNotZero:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=22) "\t\t*x = StartNotZero(v)", + (string) (len=20) "\tcase *StartNotZero:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=22) "\t\t*x = StartNotZero(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=22) "\t\t*x = StartNotZero(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=23) "\t\t*x = StartNotZero(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=23) "\t\t*x = StartNotZero(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=22) "\t\t*x = StartNotZero(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=23) "\t\t*x = StartNotZero(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=23) "\t\t*x = StartNotZero(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=23) "\t\t*x = StartNotZero(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=33) "\t\t*x, err = ParseStartNotZero(*v)", + (string) (len=17) "\t\tif err != nil {", + (string) (len=47) "\t\t\t// try parsing the integer value as a string", + (string) (len=50) "\t\t\tif val, verr := strconv.Atoi(*v); verr == nil {", + (string) (len=36) "\t\t\t\t*x, err = StartNotZero(val), nil", + (string) (len=4) "\t\t\t}", + (string) (len=3) "\t\t}", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=53) "func (x StartNotZero) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=46) "func (x *StartNotZero) Set(val string) error {", + (string) (len=33) "\tv, err := ParseStartNotZero(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=42) "func (x *StartNotZero) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=38) "func (x *StartNotZero) Type() string {", + (string) (len=22) "\treturn \"StartNotZero\"", + (string) (len=1) "}", + (string) "", + (string) (len=30) "type NullStartNotZero struct {", + (string) (len=26) "\tStartNotZero StartNotZero", + (string) (len=18) "\tValid bool", + (string) (len=18) "\tSet bool", + (string) (len=1) "}", + (string) "", + (string) (len=64) "func NewNullStartNotZero(val interface{}) (x NullStartNotZero) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=64) "func (x *NullStartNotZero) Scan(value interface{}) (err error) {", + (string) (len=13) "\tx.Set = true", + (string) (len=18) "\tif value == nil {", + (string) (len=50) "\t\tx.StartNotZero, x.Valid = StartNotZero(0), false", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=33) "\terr = x.StartNotZero.Scan(value)", + (string) (len=23) "\tx.Valid = (err == nil)", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=57) "func (x NullStartNotZero) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=46) "\t// driver.Value accepts int64 for int values.", + (string) (len=34) "\treturn int64(x.StartNotZero), nil", + (string) (len=1) "}", + (string) "", + (string) (len=63) "// MarshalJSON correctly serializes a NullStartNotZero to JSON.", + (string) (len=57) "func (n NullStartNotZero) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=37) "\t\treturn json.Marshal(n.StartNotZero)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=69) "// UnmarshalJSON correctly deserializes a NullStartNotZero from JSON.", + (string) (len=58) "func (n *NullStartNotZero) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=33) "type NullStartNotZeroStr struct {", + (string) (len=17) "\tNullStartNotZero", + (string) (len=1) "}", + (string) "", + (string) (len=70) "func NewNullStartNotZeroStr(val interface{}) (x NullStartNotZeroStr) {", + (string) (len=76) "\tx.Scan(val) // yes, we ignore this error, it will just be an invalid value.", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=60) "func (x NullStartNotZeroStr) Value() (driver.Value, error) {", + (string) (len=14) "\tif !x.Valid {", + (string) (len=17) "\t\treturn nil, nil", + (string) (len=2) "\t}", + (string) (len=36) "\treturn x.StartNotZero.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=63) "// MarshalJSON correctly serializes a NullStartNotZero to JSON.", + (string) (len=60) "func (n NullStartNotZeroStr) MarshalJSON() ([]byte, error) {", + (string) (len=23) "\tconst nullStr = \"null\"", + (string) (len=13) "\tif n.Valid {", + (string) (len=37) "\t\treturn json.Marshal(n.StartNotZero)", + (string) (len=2) "\t}", + (string) (len=28) "\treturn []byte(nullStr), nil", + (string) (len=1) "}", + (string) "", + (string) (len=69) "// UnmarshalJSON correctly deserializes a NullStartNotZero from JSON.", + (string) (len=61) "func (n *NullStartNotZeroStr) UnmarshalJSON(b []byte) error {", + (string) (len=13) "\tn.Set = true", + (string) (len=18) "\tvar x interface{}", + (string) (len=29) "\terr := json.Unmarshal(b, &x)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=16) "\terr = n.Scan(x)", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "" +} diff --git a/generator/.snapshots/TestExampleFile b/generator/.snapshots/TestExampleFile new file mode 100644 index 00000000..66263575 --- /dev/null +++ b/generator/.snapshots/TestExampleFile @@ -0,0 +1,2049 @@ +([]string) (len=2047) { + (string) (len=41) "// Code generated by go-enum DO NOT EDIT.", + (string) (len=13) "// Version: -", + (string) (len=14) "// Revision: -", + (string) (len=16) "// Build Date: -", + (string) (len=14) "// Built By: -", + (string) "", + (string) (len=17) "package generator", + (string) "", + (string) (len=8) "import (", + (string) (len=22) "\t\"database/sql/driver\"", + (string) (len=6) "\t\"fmt\"", + (string) (len=10) "\t\"strings\"", + (string) "", + (string) (len=24) "\t\"github.com/pkg/errors\"", + (string) (len=1) ")", + (string) "", + (string) (len=7) "const (", + (string) (len=38) "\t// AnimalCat is a Animal of type Cat.", + (string) (len=24) "\tAnimalCat Animal = iota", + (string) (len=38) "\t// AnimalDog is a Animal of type Dog.", + (string) (len=10) "\tAnimalDog", + (string) (len=40) "\t// AnimalFish is a Animal of type Fish.", + (string) (len=11) "\tAnimalFish", + (string) (len=1) ")", + (string) "", + (string) (len=32) "const _AnimalName = \"CatDogFish\"", + (string) "", + (string) (len=28) "var _AnimalNames = []string{", + (string) (len=18) "\t_AnimalName[0:3],", + (string) (len=18) "\t_AnimalName[3:6],", + (string) (len=19) "\t_AnimalName[6:10],", + (string) (len=1) "}", + (string) "", + (string) (len=66) "// AnimalNames returns a list of possible string values of Animal.", + (string) (len=29) "func AnimalNames() []string {", + (string) (len=41) "\ttmp := make([]string, len(_AnimalNames))", + (string) (len=24) "\tcopy(tmp, _AnimalNames)", + (string) (len=11) "\treturn tmp", + (string) (len=1) "}", + (string) "", + (string) (len=35) "var _AnimalMap = map[Animal]string{", + (string) (len=30) "\tAnimalCat: _AnimalName[0:3],", + (string) (len=30) "\tAnimalDog: _AnimalName[3:6],", + (string) (len=31) "\tAnimalFish: _AnimalName[6:10],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=33) "func (x Animal) String() string {", + (string) (len=34) "\tif str, ok := _AnimalMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=36) "\treturn fmt.Sprintf(\"Animal(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=37) "var _AnimalValue = map[string]Animal{", + (string) (len=47) "\t_AnimalName[0:3]: AnimalCat,", + (string) (len=47) "\tstrings.ToLower(_AnimalName[0:3]): AnimalCat,", + (string) (len=47) "\t_AnimalName[3:6]: AnimalDog,", + (string) (len=47) "\tstrings.ToLower(_AnimalName[3:6]): AnimalDog,", + (string) (len=48) "\t_AnimalName[6:10]: AnimalFish,", + (string) (len=48) "\tstrings.ToLower(_AnimalName[6:10]): AnimalFish,", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// ParseAnimal attempts to convert a string to a Animal.", + (string) (len=47) "func ParseAnimal(name string) (Animal, error) {", + (string) (len=37) "\tif x, ok := _AnimalValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.", + (string) (len=54) "\tif x, ok := _AnimalValue[strings.ToLower(name)]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=107) "\treturn Animal(0), fmt.Errorf(\"%s is not a valid Animal, try [%s]\", name, strings.Join(_AnimalNames, \", \"))", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=47) "func (x Animal) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=51) "func (x *Animal) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=30) "\ttmp, err := ParseAnimal(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=93) "var _AnimalErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=54) "func (x *Animal) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=16) "\t\t*x = Animal(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=16) "\t\t*x = Animal(v)", + (string) (len=13) "\tcase string:", + (string) (len=26) "\t\t*x, err = ParseAnimal(v)", + (string) (len=13) "\tcase []byte:", + (string) (len=34) "\t\t*x, err = ParseAnimal(string(v))", + (string) (len=13) "\tcase Animal:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=16) "\t\t*x = Animal(v)", + (string) (len=14) "\tcase *Animal:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=16) "\t\t*x = Animal(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=16) "\t\t*x = Animal(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=17) "\t\t*x = Animal(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=17) "\t\t*x = Animal(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=16) "\t\t*x = Animal(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=17) "\t\t*x = Animal(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=17) "\t\t*x = Animal(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=17) "\t\t*x = Animal(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=26) "\t\t\treturn _AnimalErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=27) "\t\t*x, err = ParseAnimal(*v)", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=47) "func (x Animal) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=50) "\t// CasesTest_lower is a Cases of type Test_lower.", + (string) (len=29) "\tCasesTest_lower Cases = iota", + (string) (len=54) "\t// CasesTest_capital is a Cases of type Test_capital.", + (string) (len=18) "\tCasesTest_capital", + (string) (len=72) "\t// CasesAnotherLowerCaseStart is a Cases of type AnotherLowerCaseStart.", + (string) (len=27) "\tCasesAnotherLowerCaseStart", + (string) (len=1) ")", + (string) "", + (string) (len=64) "const _CasesName = \"test_lowerTest_capitalanotherLowerCaseStart\"", + (string) "", + (string) (len=27) "var _CasesNames = []string{", + (string) (len=18) "\t_CasesName[0:10],", + (string) (len=19) "\t_CasesName[10:22],", + (string) (len=19) "\t_CasesName[22:43],", + (string) (len=1) "}", + (string) "", + (string) (len=64) "// CasesNames returns a list of possible string values of Cases.", + (string) (len=28) "func CasesNames() []string {", + (string) (len=40) "\ttmp := make([]string, len(_CasesNames))", + (string) (len=23) "\tcopy(tmp, _CasesNames)", + (string) (len=11) "\treturn tmp", + (string) (len=1) "}", + (string) "", + (string) (len=33) "var _CasesMap = map[Cases]string{", + (string) (len=46) "\tCasesTest_lower: _CasesName[0:10],", + (string) (len=47) "\tCasesTest_capital: _CasesName[10:22],", + (string) (len=47) "\tCasesAnotherLowerCaseStart: _CasesName[22:43],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=32) "func (x Cases) String() string {", + (string) (len=33) "\tif str, ok := _CasesMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=35) "\treturn fmt.Sprintf(\"Cases(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=35) "var _CasesValue = map[string]Cases{", + (string) (len=53) "\t_CasesName[0:10]: CasesTest_lower,", + (string) (len=53) "\tstrings.ToLower(_CasesName[0:10]): CasesTest_lower,", + (string) (len=55) "\t_CasesName[10:22]: CasesTest_capital,", + (string) (len=55) "\tstrings.ToLower(_CasesName[10:22]): CasesTest_capital,", + (string) (len=64) "\t_CasesName[22:43]: CasesAnotherLowerCaseStart,", + (string) (len=64) "\tstrings.ToLower(_CasesName[22:43]): CasesAnotherLowerCaseStart,", + (string) (len=1) "}", + (string) "", + (string) (len=54) "// ParseCases attempts to convert a string to a Cases.", + (string) (len=45) "func ParseCases(name string) (Cases, error) {", + (string) (len=36) "\tif x, ok := _CasesValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.", + (string) (len=53) "\tif x, ok := _CasesValue[strings.ToLower(name)]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=104) "\treturn Cases(0), fmt.Errorf(\"%s is not a valid Cases, try [%s]\", name, strings.Join(_CasesNames, \", \"))", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=46) "func (x Cases) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=50) "func (x *Cases) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=29) "\ttmp, err := ParseCases(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=92) "var _CasesErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=53) "func (x *Cases) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=15) "\t\t*x = Cases(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=15) "\t\t*x = Cases(v)", + (string) (len=13) "\tcase string:", + (string) (len=25) "\t\t*x, err = ParseCases(v)", + (string) (len=13) "\tcase []byte:", + (string) (len=33) "\t\t*x, err = ParseCases(string(v))", + (string) (len=12) "\tcase Cases:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=15) "\t\t*x = Cases(v)", + (string) (len=13) "\tcase *Cases:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=15) "\t\t*x = Cases(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=15) "\t\t*x = Cases(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Cases(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Cases(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\t*x = Cases(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Cases(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Cases(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Cases(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _CasesErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=26) "\t\t*x, err = ParseCases(*v)", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=46) "func (x Cases) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=40) "\t// ColorBlack is a Color of type Black.", + (string) (len=24) "\tColorBlack Color = iota", + (string) (len=40) "\t// ColorWhite is a Color of type White.", + (string) (len=11) "\tColorWhite", + (string) (len=36) "\t// ColorRed is a Color of type Red.", + (string) (len=9) "\tColorRed", + (string) (len=40) "\t// ColorGreen is a Color of type Green.", + (string) (len=11) "\tColorGreen", + (string) (len=38) "\t// ColorBlue is a Color of type Blue.", + (string) (len=28) "\tColorBlue Color = iota + 29", + (string) (len=38) "\t// ColorGrey is a Color of type Grey.", + (string) (len=10) "\tColorGrey", + (string) (len=42) "\t// ColorYellow is a Color of type Yellow.", + (string) (len=12) "\tColorYellow", + (string) (len=1) ")", + (string) "", + (string) (len=53) "const _ColorName = \"BlackWhiteRedGreenBluegreyyellow\"", + (string) "", + (string) (len=27) "var _ColorNames = []string{", + (string) (len=17) "\t_ColorName[0:5],", + (string) (len=18) "\t_ColorName[5:10],", + (string) (len=19) "\t_ColorName[10:13],", + (string) (len=19) "\t_ColorName[13:18],", + (string) (len=19) "\t_ColorName[18:22],", + (string) (len=19) "\t_ColorName[22:26],", + (string) (len=19) "\t_ColorName[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=64) "// ColorNames returns a list of possible string values of Color.", + (string) (len=28) "func ColorNames() []string {", + (string) (len=40) "\ttmp := make([]string, len(_ColorNames))", + (string) (len=23) "\tcopy(tmp, _ColorNames)", + (string) (len=11) "\treturn tmp", + (string) (len=1) "}", + (string) "", + (string) (len=33) "var _ColorMap = map[Color]string{", + (string) (len=30) "\tColorBlack: _ColorName[0:5],", + (string) (len=31) "\tColorWhite: _ColorName[5:10],", + (string) (len=32) "\tColorRed: _ColorName[10:13],", + (string) (len=32) "\tColorGreen: _ColorName[13:18],", + (string) (len=32) "\tColorBlue: _ColorName[18:22],", + (string) (len=32) "\tColorGrey: _ColorName[22:26],", + (string) (len=32) "\tColorYellow: _ColorName[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=32) "func (x Color) String() string {", + (string) (len=33) "\tif str, ok := _ColorMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=35) "\treturn fmt.Sprintf(\"Color(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=35) "var _ColorValue = map[string]Color{", + (string) (len=48) "\t_ColorName[0:5]: ColorBlack,", + (string) (len=48) "\tstrings.ToLower(_ColorName[0:5]): ColorBlack,", + (string) (len=48) "\t_ColorName[5:10]: ColorWhite,", + (string) (len=48) "\tstrings.ToLower(_ColorName[5:10]): ColorWhite,", + (string) (len=46) "\t_ColorName[10:13]: ColorRed,", + (string) (len=46) "\tstrings.ToLower(_ColorName[10:13]): ColorRed,", + (string) (len=48) "\t_ColorName[13:18]: ColorGreen,", + (string) (len=48) "\tstrings.ToLower(_ColorName[13:18]): ColorGreen,", + (string) (len=47) "\t_ColorName[18:22]: ColorBlue,", + (string) (len=47) "\tstrings.ToLower(_ColorName[18:22]): ColorBlue,", + (string) (len=47) "\t_ColorName[22:26]: ColorGrey,", + (string) (len=47) "\tstrings.ToLower(_ColorName[22:26]): ColorGrey,", + (string) (len=49) "\t_ColorName[26:32]: ColorYellow,", + (string) (len=49) "\tstrings.ToLower(_ColorName[26:32]): ColorYellow,", + (string) (len=1) "}", + (string) "", + (string) (len=54) "// ParseColor attempts to convert a string to a Color.", + (string) (len=45) "func ParseColor(name string) (Color, error) {", + (string) (len=36) "\tif x, ok := _ColorValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.", + (string) (len=53) "\tif x, ok := _ColorValue[strings.ToLower(name)]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=104) "\treturn Color(0), fmt.Errorf(\"%s is not a valid Color, try [%s]\", name, strings.Join(_ColorNames, \", \"))", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=46) "func (x Color) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=50) "func (x *Color) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=29) "\ttmp, err := ParseColor(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=92) "var _ColorErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=53) "func (x *Color) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=15) "\t\t*x = Color(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=15) "\t\t*x = Color(v)", + (string) (len=13) "\tcase string:", + (string) (len=25) "\t\t*x, err = ParseColor(v)", + (string) (len=13) "\tcase []byte:", + (string) (len=33) "\t\t*x, err = ParseColor(string(v))", + (string) (len=12) "\tcase Color:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=15) "\t\t*x = Color(v)", + (string) (len=13) "\tcase *Color:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=15) "\t\t*x = Color(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=15) "\t\t*x = Color(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Color(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Color(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\t*x = Color(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Color(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Color(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Color(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ColorErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=26) "\t\t*x, err = ParseColor(*v)", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=46) "func (x Color) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=62) "\t// ColorWithCommentBlack is a ColorWithComment of type Black.", + (string) (len=46) "\tColorWithCommentBlack ColorWithComment = iota", + (string) (len=62) "\t// ColorWithCommentWhite is a ColorWithComment of type White.", + (string) (len=22) "\tColorWithCommentWhite", + (string) (len=58) "\t// ColorWithCommentRed is a ColorWithComment of type Red.", + (string) (len=20) "\tColorWithCommentRed", + (string) (len=62) "\t// ColorWithCommentGreen is a ColorWithComment of type Green.", + (string) (len=22) "\tColorWithCommentGreen", + (string) (len=60) "\t// ColorWithCommentBlue is a ColorWithComment of type Blue.", + (string) (len=23) "\t// Blue starts with 33", + (string) (len=50) "\tColorWithCommentBlue ColorWithComment = iota + 29", + (string) (len=60) "\t// ColorWithCommentGrey is a ColorWithComment of type Grey.", + (string) (len=21) "\tColorWithCommentGrey", + (string) (len=64) "\t// ColorWithCommentYellow is a ColorWithComment of type Yellow.", + (string) (len=23) "\tColorWithCommentYellow", + (string) (len=1) ")", + (string) "", + (string) (len=64) "const _ColorWithCommentName = \"BlackWhiteRedGreenBluegreyyellow\"", + (string) "", + (string) (len=38) "var _ColorWithCommentNames = []string{", + (string) (len=28) "\t_ColorWithCommentName[0:5],", + (string) (len=29) "\t_ColorWithCommentName[5:10],", + (string) (len=30) "\t_ColorWithCommentName[10:13],", + (string) (len=30) "\t_ColorWithCommentName[13:18],", + (string) (len=30) "\t_ColorWithCommentName[18:22],", + (string) (len=30) "\t_ColorWithCommentName[22:26],", + (string) (len=30) "\t_ColorWithCommentName[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=86) "// ColorWithCommentNames returns a list of possible string values of ColorWithComment.", + (string) (len=39) "func ColorWithCommentNames() []string {", + (string) (len=51) "\ttmp := make([]string, len(_ColorWithCommentNames))", + (string) (len=34) "\tcopy(tmp, _ColorWithCommentNames)", + (string) (len=11) "\treturn tmp", + (string) (len=1) "}", + (string) "", + (string) (len=55) "var _ColorWithCommentMap = map[ColorWithComment]string{", + (string) (len=52) "\tColorWithCommentBlack: _ColorWithCommentName[0:5],", + (string) (len=53) "\tColorWithCommentWhite: _ColorWithCommentName[5:10],", + (string) (len=54) "\tColorWithCommentRed: _ColorWithCommentName[10:13],", + (string) (len=54) "\tColorWithCommentGreen: _ColorWithCommentName[13:18],", + (string) (len=54) "\tColorWithCommentBlue: _ColorWithCommentName[18:22],", + (string) (len=54) "\tColorWithCommentGrey: _ColorWithCommentName[22:26],", + (string) (len=54) "\tColorWithCommentYellow: _ColorWithCommentName[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=43) "func (x ColorWithComment) String() string {", + (string) (len=44) "\tif str, ok := _ColorWithCommentMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=46) "\treturn fmt.Sprintf(\"ColorWithComment(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=57) "var _ColorWithCommentValue = map[string]ColorWithComment{", + (string) (len=70) "\t_ColorWithCommentName[0:5]: ColorWithCommentBlack,", + (string) (len=70) "\tstrings.ToLower(_ColorWithCommentName[0:5]): ColorWithCommentBlack,", + (string) (len=70) "\t_ColorWithCommentName[5:10]: ColorWithCommentWhite,", + (string) (len=70) "\tstrings.ToLower(_ColorWithCommentName[5:10]): ColorWithCommentWhite,", + (string) (len=68) "\t_ColorWithCommentName[10:13]: ColorWithCommentRed,", + (string) (len=68) "\tstrings.ToLower(_ColorWithCommentName[10:13]): ColorWithCommentRed,", + (string) (len=70) "\t_ColorWithCommentName[13:18]: ColorWithCommentGreen,", + (string) (len=70) "\tstrings.ToLower(_ColorWithCommentName[13:18]): ColorWithCommentGreen,", + (string) (len=69) "\t_ColorWithCommentName[18:22]: ColorWithCommentBlue,", + (string) (len=69) "\tstrings.ToLower(_ColorWithCommentName[18:22]): ColorWithCommentBlue,", + (string) (len=69) "\t_ColorWithCommentName[22:26]: ColorWithCommentGrey,", + (string) (len=69) "\tstrings.ToLower(_ColorWithCommentName[22:26]): ColorWithCommentGrey,", + (string) (len=71) "\t_ColorWithCommentName[26:32]: ColorWithCommentYellow,", + (string) (len=71) "\tstrings.ToLower(_ColorWithCommentName[26:32]): ColorWithCommentYellow,", + (string) (len=1) "}", + (string) "", + (string) (len=76) "// ParseColorWithComment attempts to convert a string to a ColorWithComment.", + (string) (len=67) "func ParseColorWithComment(name string) (ColorWithComment, error) {", + (string) (len=47) "\tif x, ok := _ColorWithCommentValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.", + (string) (len=64) "\tif x, ok := _ColorWithCommentValue[strings.ToLower(name)]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=137) "\treturn ColorWithComment(0), fmt.Errorf(\"%s is not a valid ColorWithComment, try [%s]\", name, strings.Join(_ColorWithCommentNames, \", \"))", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=57) "func (x ColorWithComment) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=61) "func (x *ColorWithComment) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=40) "\ttmp, err := ParseColorWithComment(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=103) "var _ColorWithCommentErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=64) "func (x *ColorWithComment) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=26) "\t\t*x = ColorWithComment(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=26) "\t\t*x = ColorWithComment(v)", + (string) (len=13) "\tcase string:", + (string) (len=36) "\t\t*x, err = ParseColorWithComment(v)", + (string) (len=13) "\tcase []byte:", + (string) (len=44) "\t\t*x, err = ParseColorWithComment(string(v))", + (string) (len=23) "\tcase ColorWithComment:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=26) "\t\t*x = ColorWithComment(v)", + (string) (len=24) "\tcase *ColorWithComment:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=26) "\t\t*x = ColorWithComment(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=26) "\t\t*x = ColorWithComment(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=27) "\t\t*x = ColorWithComment(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=27) "\t\t*x = ColorWithComment(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=26) "\t\t*x = ColorWithComment(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=27) "\t\t*x = ColorWithComment(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=27) "\t\t*x = ColorWithComment(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=27) "\t\t*x = ColorWithComment(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=36) "\t\t\treturn _ColorWithCommentErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=37) "\t\t*x, err = ParseColorWithComment(*v)", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=57) "func (x ColorWithComment) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=64) "\t// ColorWithComment2Black is a ColorWithComment2 of type Black.", + (string) (len=48) "\tColorWithComment2Black ColorWithComment2 = iota", + (string) (len=64) "\t// ColorWithComment2White is a ColorWithComment2 of type White.", + (string) (len=23) "\tColorWithComment2White", + (string) (len=60) "\t// ColorWithComment2Red is a ColorWithComment2 of type Red.", + (string) (len=21) "\tColorWithComment2Red", + (string) (len=64) "\t// ColorWithComment2Green is a ColorWithComment2 of type Green.", + (string) (len=23) "\tColorWithComment2Green", + (string) (len=62) "\t// ColorWithComment2Blue is a ColorWithComment2 of type Blue.", + (string) (len=23) "\t// Blue starts with 33", + (string) (len=52) "\tColorWithComment2Blue ColorWithComment2 = iota + 29", + (string) (len=62) "\t// ColorWithComment2Grey is a ColorWithComment2 of type Grey.", + (string) (len=22) "\tColorWithComment2Grey", + (string) (len=66) "\t// ColorWithComment2Yellow is a ColorWithComment2 of type Yellow.", + (string) (len=24) "\tColorWithComment2Yellow", + (string) (len=1) ")", + (string) "", + (string) (len=65) "const _ColorWithComment2Name = \"BlackWhiteRedGreenBluegreyyellow\"", + (string) "", + (string) (len=39) "var _ColorWithComment2Names = []string{", + (string) (len=29) "\t_ColorWithComment2Name[0:5],", + (string) (len=30) "\t_ColorWithComment2Name[5:10],", + (string) (len=31) "\t_ColorWithComment2Name[10:13],", + (string) (len=31) "\t_ColorWithComment2Name[13:18],", + (string) (len=31) "\t_ColorWithComment2Name[18:22],", + (string) (len=31) "\t_ColorWithComment2Name[22:26],", + (string) (len=31) "\t_ColorWithComment2Name[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=88) "// ColorWithComment2Names returns a list of possible string values of ColorWithComment2.", + (string) (len=40) "func ColorWithComment2Names() []string {", + (string) (len=52) "\ttmp := make([]string, len(_ColorWithComment2Names))", + (string) (len=35) "\tcopy(tmp, _ColorWithComment2Names)", + (string) (len=11) "\treturn tmp", + (string) (len=1) "}", + (string) "", + (string) (len=57) "var _ColorWithComment2Map = map[ColorWithComment2]string{", + (string) (len=54) "\tColorWithComment2Black: _ColorWithComment2Name[0:5],", + (string) (len=55) "\tColorWithComment2White: _ColorWithComment2Name[5:10],", + (string) (len=56) "\tColorWithComment2Red: _ColorWithComment2Name[10:13],", + (string) (len=56) "\tColorWithComment2Green: _ColorWithComment2Name[13:18],", + (string) (len=56) "\tColorWithComment2Blue: _ColorWithComment2Name[18:22],", + (string) (len=56) "\tColorWithComment2Grey: _ColorWithComment2Name[22:26],", + (string) (len=56) "\tColorWithComment2Yellow: _ColorWithComment2Name[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=44) "func (x ColorWithComment2) String() string {", + (string) (len=45) "\tif str, ok := _ColorWithComment2Map[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=47) "\treturn fmt.Sprintf(\"ColorWithComment2(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=59) "var _ColorWithComment2Value = map[string]ColorWithComment2{", + (string) (len=72) "\t_ColorWithComment2Name[0:5]: ColorWithComment2Black,", + (string) (len=72) "\tstrings.ToLower(_ColorWithComment2Name[0:5]): ColorWithComment2Black,", + (string) (len=72) "\t_ColorWithComment2Name[5:10]: ColorWithComment2White,", + (string) (len=72) "\tstrings.ToLower(_ColorWithComment2Name[5:10]): ColorWithComment2White,", + (string) (len=70) "\t_ColorWithComment2Name[10:13]: ColorWithComment2Red,", + (string) (len=70) "\tstrings.ToLower(_ColorWithComment2Name[10:13]): ColorWithComment2Red,", + (string) (len=72) "\t_ColorWithComment2Name[13:18]: ColorWithComment2Green,", + (string) (len=72) "\tstrings.ToLower(_ColorWithComment2Name[13:18]): ColorWithComment2Green,", + (string) (len=71) "\t_ColorWithComment2Name[18:22]: ColorWithComment2Blue,", + (string) (len=71) "\tstrings.ToLower(_ColorWithComment2Name[18:22]): ColorWithComment2Blue,", + (string) (len=71) "\t_ColorWithComment2Name[22:26]: ColorWithComment2Grey,", + (string) (len=71) "\tstrings.ToLower(_ColorWithComment2Name[22:26]): ColorWithComment2Grey,", + (string) (len=73) "\t_ColorWithComment2Name[26:32]: ColorWithComment2Yellow,", + (string) (len=73) "\tstrings.ToLower(_ColorWithComment2Name[26:32]): ColorWithComment2Yellow,", + (string) (len=1) "}", + (string) "", + (string) (len=78) "// ParseColorWithComment2 attempts to convert a string to a ColorWithComment2.", + (string) (len=69) "func ParseColorWithComment2(name string) (ColorWithComment2, error) {", + (string) (len=48) "\tif x, ok := _ColorWithComment2Value[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.", + (string) (len=65) "\tif x, ok := _ColorWithComment2Value[strings.ToLower(name)]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=140) "\treturn ColorWithComment2(0), fmt.Errorf(\"%s is not a valid ColorWithComment2, try [%s]\", name, strings.Join(_ColorWithComment2Names, \", \"))", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=58) "func (x ColorWithComment2) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=62) "func (x *ColorWithComment2) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=41) "\ttmp, err := ParseColorWithComment2(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=104) "var _ColorWithComment2ErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=65) "func (x *ColorWithComment2) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=27) "\t\t*x = ColorWithComment2(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=27) "\t\t*x = ColorWithComment2(v)", + (string) (len=13) "\tcase string:", + (string) (len=37) "\t\t*x, err = ParseColorWithComment2(v)", + (string) (len=13) "\tcase []byte:", + (string) (len=45) "\t\t*x, err = ParseColorWithComment2(string(v))", + (string) (len=24) "\tcase ColorWithComment2:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=27) "\t\t*x = ColorWithComment2(v)", + (string) (len=25) "\tcase *ColorWithComment2:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=27) "\t\t*x = ColorWithComment2(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=27) "\t\t*x = ColorWithComment2(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment2(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment2(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=27) "\t\t*x = ColorWithComment2(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment2(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment2(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment2(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment2ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=38) "\t\t*x, err = ParseColorWithComment2(*v)", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=58) "func (x ColorWithComment2) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=64) "\t// ColorWithComment3Black is a ColorWithComment3 of type Black.", + (string) (len=48) "\tColorWithComment3Black ColorWithComment3 = iota", + (string) (len=64) "\t// ColorWithComment3White is a ColorWithComment3 of type White.", + (string) (len=23) "\tColorWithComment3White", + (string) (len=60) "\t// ColorWithComment3Red is a ColorWithComment3 of type Red.", + (string) (len=21) "\tColorWithComment3Red", + (string) (len=64) "\t// ColorWithComment3Green is a ColorWithComment3 of type Green.", + (string) (len=24) "\t// Green starts with 33", + (string) (len=53) "\tColorWithComment3Green ColorWithComment3 = iota + 30", + (string) (len=62) "\t// ColorWithComment3Blue is a ColorWithComment3 of type Blue.", + (string) (len=22) "\tColorWithComment3Blue", + (string) (len=62) "\t// ColorWithComment3Grey is a ColorWithComment3 of type Grey.", + (string) (len=22) "\tColorWithComment3Grey", + (string) (len=66) "\t// ColorWithComment3Yellow is a ColorWithComment3 of type Yellow.", + (string) (len=24) "\tColorWithComment3Yellow", + (string) (len=73) "\t// ColorWithComment3BlueGreen is a ColorWithComment3 of type Blue-Green.", + (string) (len=22) "\t// blue-green comment", + (string) (len=27) "\tColorWithComment3BlueGreen", + (string) (len=73) "\t// ColorWithComment3RedOrange is a ColorWithComment3 of type Red-Orange.", + (string) (len=27) "\tColorWithComment3RedOrange", + (string) (len=82) "\t// ColorWithComment3RedOrangeBlue is a ColorWithComment3 of type Red-Orange-Blue.", + (string) (len=31) "\tColorWithComment3RedOrangeBlue", + (string) (len=1) ")", + (string) "", + (string) (len=100) "const _ColorWithComment3Name = \"BlackWhiteRedGreenBluegreyyellowblue-greenred-orangered-orange-blue\"", + (string) "", + (string) (len=39) "var _ColorWithComment3Names = []string{", + (string) (len=29) "\t_ColorWithComment3Name[0:5],", + (string) (len=30) "\t_ColorWithComment3Name[5:10],", + (string) (len=31) "\t_ColorWithComment3Name[10:13],", + (string) (len=31) "\t_ColorWithComment3Name[13:18],", + (string) (len=31) "\t_ColorWithComment3Name[18:22],", + (string) (len=31) "\t_ColorWithComment3Name[22:26],", + (string) (len=31) "\t_ColorWithComment3Name[26:32],", + (string) (len=31) "\t_ColorWithComment3Name[32:42],", + (string) (len=31) "\t_ColorWithComment3Name[42:52],", + (string) (len=31) "\t_ColorWithComment3Name[52:67],", + (string) (len=1) "}", + (string) "", + (string) (len=88) "// ColorWithComment3Names returns a list of possible string values of ColorWithComment3.", + (string) (len=40) "func ColorWithComment3Names() []string {", + (string) (len=52) "\ttmp := make([]string, len(_ColorWithComment3Names))", + (string) (len=35) "\tcopy(tmp, _ColorWithComment3Names)", + (string) (len=11) "\treturn tmp", + (string) (len=1) "}", + (string) "", + (string) (len=57) "var _ColorWithComment3Map = map[ColorWithComment3]string{", + (string) (len=61) "\tColorWithComment3Black: _ColorWithComment3Name[0:5],", + (string) (len=62) "\tColorWithComment3White: _ColorWithComment3Name[5:10],", + (string) (len=63) "\tColorWithComment3Red: _ColorWithComment3Name[10:13],", + (string) (len=63) "\tColorWithComment3Green: _ColorWithComment3Name[13:18],", + (string) (len=63) "\tColorWithComment3Blue: _ColorWithComment3Name[18:22],", + (string) (len=63) "\tColorWithComment3Grey: _ColorWithComment3Name[22:26],", + (string) (len=63) "\tColorWithComment3Yellow: _ColorWithComment3Name[26:32],", + (string) (len=63) "\tColorWithComment3BlueGreen: _ColorWithComment3Name[32:42],", + (string) (len=63) "\tColorWithComment3RedOrange: _ColorWithComment3Name[42:52],", + (string) (len=63) "\tColorWithComment3RedOrangeBlue: _ColorWithComment3Name[52:67],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=44) "func (x ColorWithComment3) String() string {", + (string) (len=45) "\tif str, ok := _ColorWithComment3Map[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=47) "\treturn fmt.Sprintf(\"ColorWithComment3(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=59) "var _ColorWithComment3Value = map[string]ColorWithComment3{", + (string) (len=72) "\t_ColorWithComment3Name[0:5]: ColorWithComment3Black,", + (string) (len=72) "\tstrings.ToLower(_ColorWithComment3Name[0:5]): ColorWithComment3Black,", + (string) (len=72) "\t_ColorWithComment3Name[5:10]: ColorWithComment3White,", + (string) (len=72) "\tstrings.ToLower(_ColorWithComment3Name[5:10]): ColorWithComment3White,", + (string) (len=70) "\t_ColorWithComment3Name[10:13]: ColorWithComment3Red,", + (string) (len=70) "\tstrings.ToLower(_ColorWithComment3Name[10:13]): ColorWithComment3Red,", + (string) (len=72) "\t_ColorWithComment3Name[13:18]: ColorWithComment3Green,", + (string) (len=72) "\tstrings.ToLower(_ColorWithComment3Name[13:18]): ColorWithComment3Green,", + (string) (len=71) "\t_ColorWithComment3Name[18:22]: ColorWithComment3Blue,", + (string) (len=71) "\tstrings.ToLower(_ColorWithComment3Name[18:22]): ColorWithComment3Blue,", + (string) (len=71) "\t_ColorWithComment3Name[22:26]: ColorWithComment3Grey,", + (string) (len=71) "\tstrings.ToLower(_ColorWithComment3Name[22:26]): ColorWithComment3Grey,", + (string) (len=73) "\t_ColorWithComment3Name[26:32]: ColorWithComment3Yellow,", + (string) (len=73) "\tstrings.ToLower(_ColorWithComment3Name[26:32]): ColorWithComment3Yellow,", + (string) (len=76) "\t_ColorWithComment3Name[32:42]: ColorWithComment3BlueGreen,", + (string) (len=76) "\tstrings.ToLower(_ColorWithComment3Name[32:42]): ColorWithComment3BlueGreen,", + (string) (len=76) "\t_ColorWithComment3Name[42:52]: ColorWithComment3RedOrange,", + (string) (len=76) "\tstrings.ToLower(_ColorWithComment3Name[42:52]): ColorWithComment3RedOrange,", + (string) (len=80) "\t_ColorWithComment3Name[52:67]: ColorWithComment3RedOrangeBlue,", + (string) (len=80) "\tstrings.ToLower(_ColorWithComment3Name[52:67]): ColorWithComment3RedOrangeBlue,", + (string) (len=1) "}", + (string) "", + (string) (len=78) "// ParseColorWithComment3 attempts to convert a string to a ColorWithComment3.", + (string) (len=69) "func ParseColorWithComment3(name string) (ColorWithComment3, error) {", + (string) (len=48) "\tif x, ok := _ColorWithComment3Value[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.", + (string) (len=65) "\tif x, ok := _ColorWithComment3Value[strings.ToLower(name)]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=140) "\treturn ColorWithComment3(0), fmt.Errorf(\"%s is not a valid ColorWithComment3, try [%s]\", name, strings.Join(_ColorWithComment3Names, \", \"))", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=58) "func (x ColorWithComment3) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=62) "func (x *ColorWithComment3) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=41) "\ttmp, err := ParseColorWithComment3(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=104) "var _ColorWithComment3ErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=65) "func (x *ColorWithComment3) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=27) "\t\t*x = ColorWithComment3(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=27) "\t\t*x = ColorWithComment3(v)", + (string) (len=13) "\tcase string:", + (string) (len=37) "\t\t*x, err = ParseColorWithComment3(v)", + (string) (len=13) "\tcase []byte:", + (string) (len=45) "\t\t*x, err = ParseColorWithComment3(string(v))", + (string) (len=24) "\tcase ColorWithComment3:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=27) "\t\t*x = ColorWithComment3(v)", + (string) (len=25) "\tcase *ColorWithComment3:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=27) "\t\t*x = ColorWithComment3(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=27) "\t\t*x = ColorWithComment3(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment3(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment3(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=27) "\t\t*x = ColorWithComment3(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment3(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment3(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment3(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment3ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=38) "\t\t*x, err = ParseColorWithComment3(*v)", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=58) "func (x ColorWithComment3) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=18) "\t// Skipped value.", + (string) (len=15) "\t// Placeholder", + (string) (len=27) "\t_ ColorWithComment4 = iota", + (string) (len=64) "\t// ColorWithComment4Black is a ColorWithComment4 of type Black.", + (string) (len=23) "\tColorWithComment4Black", + (string) (len=64) "\t// ColorWithComment4White is a ColorWithComment4 of type White.", + (string) (len=23) "\tColorWithComment4White", + (string) (len=60) "\t// ColorWithComment4Red is a ColorWithComment4 of type Red.", + (string) (len=21) "\tColorWithComment4Red", + (string) (len=64) "\t// ColorWithComment4Green is a ColorWithComment4 of type Green.", + (string) (len=24) "\t// Green starts with 33", + (string) (len=53) "\tColorWithComment4Green ColorWithComment4 = iota + 29", + (string) (len=62) "\t// ColorWithComment4Blue is a ColorWithComment4 of type Blue.", + (string) (len=22) "\tColorWithComment4Blue", + (string) (len=62) "\t// ColorWithComment4Grey is a ColorWithComment4 of type Grey.", + (string) (len=22) "\tColorWithComment4Grey", + (string) (len=66) "\t// ColorWithComment4Yellow is a ColorWithComment4 of type Yellow.", + (string) (len=110) "\t// Where did all the (somewhat) bad fish go? (something else that goes in parentheses at the end of the line)", + (string) (len=24) "\tColorWithComment4Yellow", + (string) (len=73) "\t// ColorWithComment4BlueGreen is a ColorWithComment4 of type Blue-Green.", + (string) (len=22) "\t// blue-green comment", + (string) (len=27) "\tColorWithComment4BlueGreen", + (string) (len=73) "\t// ColorWithComment4RedOrange is a ColorWithComment4 of type Red-Orange.", + (string) (len=20) "\t// has a , in it!?!", + (string) (len=27) "\tColorWithComment4RedOrange", + (string) (len=1) ")", + (string) "", + (string) (len=85) "const _ColorWithComment4Name = \"BlackWhiteRedGreenBluegreyyellowblue-greenred-orange\"", + (string) "", + (string) (len=39) "var _ColorWithComment4Names = []string{", + (string) (len=29) "\t_ColorWithComment4Name[0:5],", + (string) (len=30) "\t_ColorWithComment4Name[5:10],", + (string) (len=31) "\t_ColorWithComment4Name[10:13],", + (string) (len=31) "\t_ColorWithComment4Name[13:18],", + (string) (len=31) "\t_ColorWithComment4Name[18:22],", + (string) (len=31) "\t_ColorWithComment4Name[22:26],", + (string) (len=31) "\t_ColorWithComment4Name[26:32],", + (string) (len=31) "\t_ColorWithComment4Name[32:42],", + (string) (len=31) "\t_ColorWithComment4Name[42:52],", + (string) (len=1) "}", + (string) "", + (string) (len=88) "// ColorWithComment4Names returns a list of possible string values of ColorWithComment4.", + (string) (len=40) "func ColorWithComment4Names() []string {", + (string) (len=52) "\ttmp := make([]string, len(_ColorWithComment4Names))", + (string) (len=35) "\tcopy(tmp, _ColorWithComment4Names)", + (string) (len=11) "\treturn tmp", + (string) (len=1) "}", + (string) "", + (string) (len=57) "var _ColorWithComment4Map = map[ColorWithComment4]string{", + (string) (len=57) "\tColorWithComment4Black: _ColorWithComment4Name[0:5],", + (string) (len=58) "\tColorWithComment4White: _ColorWithComment4Name[5:10],", + (string) (len=59) "\tColorWithComment4Red: _ColorWithComment4Name[10:13],", + (string) (len=59) "\tColorWithComment4Green: _ColorWithComment4Name[13:18],", + (string) (len=59) "\tColorWithComment4Blue: _ColorWithComment4Name[18:22],", + (string) (len=59) "\tColorWithComment4Grey: _ColorWithComment4Name[22:26],", + (string) (len=59) "\tColorWithComment4Yellow: _ColorWithComment4Name[26:32],", + (string) (len=59) "\tColorWithComment4BlueGreen: _ColorWithComment4Name[32:42],", + (string) (len=59) "\tColorWithComment4RedOrange: _ColorWithComment4Name[42:52],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=44) "func (x ColorWithComment4) String() string {", + (string) (len=45) "\tif str, ok := _ColorWithComment4Map[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=47) "\treturn fmt.Sprintf(\"ColorWithComment4(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=59) "var _ColorWithComment4Value = map[string]ColorWithComment4{", + (string) (len=72) "\t_ColorWithComment4Name[0:5]: ColorWithComment4Black,", + (string) (len=72) "\tstrings.ToLower(_ColorWithComment4Name[0:5]): ColorWithComment4Black,", + (string) (len=72) "\t_ColorWithComment4Name[5:10]: ColorWithComment4White,", + (string) (len=72) "\tstrings.ToLower(_ColorWithComment4Name[5:10]): ColorWithComment4White,", + (string) (len=70) "\t_ColorWithComment4Name[10:13]: ColorWithComment4Red,", + (string) (len=70) "\tstrings.ToLower(_ColorWithComment4Name[10:13]): ColorWithComment4Red,", + (string) (len=72) "\t_ColorWithComment4Name[13:18]: ColorWithComment4Green,", + (string) (len=72) "\tstrings.ToLower(_ColorWithComment4Name[13:18]): ColorWithComment4Green,", + (string) (len=71) "\t_ColorWithComment4Name[18:22]: ColorWithComment4Blue,", + (string) (len=71) "\tstrings.ToLower(_ColorWithComment4Name[18:22]): ColorWithComment4Blue,", + (string) (len=71) "\t_ColorWithComment4Name[22:26]: ColorWithComment4Grey,", + (string) (len=71) "\tstrings.ToLower(_ColorWithComment4Name[22:26]): ColorWithComment4Grey,", + (string) (len=73) "\t_ColorWithComment4Name[26:32]: ColorWithComment4Yellow,", + (string) (len=73) "\tstrings.ToLower(_ColorWithComment4Name[26:32]): ColorWithComment4Yellow,", + (string) (len=76) "\t_ColorWithComment4Name[32:42]: ColorWithComment4BlueGreen,", + (string) (len=76) "\tstrings.ToLower(_ColorWithComment4Name[32:42]): ColorWithComment4BlueGreen,", + (string) (len=76) "\t_ColorWithComment4Name[42:52]: ColorWithComment4RedOrange,", + (string) (len=76) "\tstrings.ToLower(_ColorWithComment4Name[42:52]): ColorWithComment4RedOrange,", + (string) (len=1) "}", + (string) "", + (string) (len=78) "// ParseColorWithComment4 attempts to convert a string to a ColorWithComment4.", + (string) (len=69) "func ParseColorWithComment4(name string) (ColorWithComment4, error) {", + (string) (len=48) "\tif x, ok := _ColorWithComment4Value[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.", + (string) (len=65) "\tif x, ok := _ColorWithComment4Value[strings.ToLower(name)]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=140) "\treturn ColorWithComment4(0), fmt.Errorf(\"%s is not a valid ColorWithComment4, try [%s]\", name, strings.Join(_ColorWithComment4Names, \", \"))", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=58) "func (x ColorWithComment4) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=62) "func (x *ColorWithComment4) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=41) "\ttmp, err := ParseColorWithComment4(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=104) "var _ColorWithComment4ErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=65) "func (x *ColorWithComment4) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=27) "\t\t*x = ColorWithComment4(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=27) "\t\t*x = ColorWithComment4(v)", + (string) (len=13) "\tcase string:", + (string) (len=37) "\t\t*x, err = ParseColorWithComment4(v)", + (string) (len=13) "\tcase []byte:", + (string) (len=45) "\t\t*x, err = ParseColorWithComment4(string(v))", + (string) (len=24) "\tcase ColorWithComment4:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=27) "\t\t*x = ColorWithComment4(v)", + (string) (len=25) "\tcase *ColorWithComment4:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=27) "\t\t*x = ColorWithComment4(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=27) "\t\t*x = ColorWithComment4(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment4(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment4(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=27) "\t\t*x = ColorWithComment4(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment4(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment4(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=28) "\t\t*x = ColorWithComment4(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=37) "\t\t\treturn _ColorWithComment4ErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=38) "\t\t*x, err = ParseColorWithComment4(*v)", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=58) "func (x ColorWithComment4) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=52) "\t// Enum64bitUnknown is a Enum64bit of type Unknown.", + (string) (len=34) "\tEnum64bitUnknown Enum64bit = iota", + (string) (len=48) "\t// Enum64bitE2P15 is a Enum64bit of type E2P15.", + (string) (len=40) "\tEnum64bitE2P15 Enum64bit = iota + 32767", + (string) (len=48) "\t// Enum64bitE2P16 is a Enum64bit of type E2P16.", + (string) (len=40) "\tEnum64bitE2P16 Enum64bit = iota + 65534", + (string) (len=48) "\t// Enum64bitE2P17 is a Enum64bit of type E2P17.", + (string) (len=41) "\tEnum64bitE2P17 Enum64bit = iota + 131069", + (string) (len=48) "\t// Enum64bitE2P18 is a Enum64bit of type E2P18.", + (string) (len=41) "\tEnum64bitE2P18 Enum64bit = iota + 262140", + (string) (len=48) "\t// Enum64bitE2P19 is a Enum64bit of type E2P19.", + (string) (len=41) "\tEnum64bitE2P19 Enum64bit = iota + 524283", + (string) (len=48) "\t// Enum64bitE2P20 is a Enum64bit of type E2P20.", + (string) (len=42) "\tEnum64bitE2P20 Enum64bit = iota + 1048570", + (string) (len=48) "\t// Enum64bitE2P21 is a Enum64bit of type E2P21.", + (string) (len=42) "\tEnum64bitE2P21 Enum64bit = iota + 2097145", + (string) (len=48) "\t// Enum64bitE2P22 is a Enum64bit of type E2P22.", + (string) (len=43) "\tEnum64bitE2P22 Enum64bit = iota + 33554424", + (string) (len=48) "\t// Enum64bitE2P23 is a Enum64bit of type E2P23.", + (string) (len=43) "\tEnum64bitE2P23 Enum64bit = iota + 67108855", + (string) (len=48) "\t// Enum64bitE2P28 is a Enum64bit of type E2P28.", + (string) (len=44) "\tEnum64bitE2P28 Enum64bit = iota + 536870902", + (string) (len=48) "\t// Enum64bitE2P30 is a Enum64bit of type E2P30.", + (string) (len=45) "\tEnum64bitE2P30 Enum64bit = iota + 1073741813", + (string) (len=48) "\t// Enum64bitE2P31 is a Enum64bit of type E2P31.", + (string) (len=45) "\tEnum64bitE2P31 Enum64bit = iota + 2147483636", + (string) (len=48) "\t// Enum64bitE2P32 is a Enum64bit of type E2P32.", + (string) (len=45) "\tEnum64bitE2P32 Enum64bit = iota + 4294967283", + (string) (len=48) "\t// Enum64bitE2P33 is a Enum64bit of type E2P33.", + (string) (len=45) "\tEnum64bitE2P33 Enum64bit = iota + 8454967282", + (string) (len=1) ")", + (string) "", + (string) (len=102) "const _Enum64bitName = \"UnknownE2P15E2P16E2P17E2P18E2P19E2P20E2P21E2P22E2P23E2P28E2P30E2P31E2P32E2P33\"", + (string) "", + (string) (len=31) "var _Enum64bitNames = []string{", + (string) (len=21) "\t_Enum64bitName[0:7],", + (string) (len=22) "\t_Enum64bitName[7:12],", + (string) (len=23) "\t_Enum64bitName[12:17],", + (string) (len=23) "\t_Enum64bitName[17:22],", + (string) (len=23) "\t_Enum64bitName[22:27],", + (string) (len=23) "\t_Enum64bitName[27:32],", + (string) (len=23) "\t_Enum64bitName[32:37],", + (string) (len=23) "\t_Enum64bitName[37:42],", + (string) (len=23) "\t_Enum64bitName[42:47],", + (string) (len=23) "\t_Enum64bitName[47:52],", + (string) (len=23) "\t_Enum64bitName[52:57],", + (string) (len=23) "\t_Enum64bitName[57:62],", + (string) (len=23) "\t_Enum64bitName[62:67],", + (string) (len=23) "\t_Enum64bitName[67:72],", + (string) (len=23) "\t_Enum64bitName[72:77],", + (string) (len=1) "}", + (string) "", + (string) (len=72) "// Enum64bitNames returns a list of possible string values of Enum64bit.", + (string) (len=32) "func Enum64bitNames() []string {", + (string) (len=44) "\ttmp := make([]string, len(_Enum64bitNames))", + (string) (len=27) "\tcopy(tmp, _Enum64bitNames)", + (string) (len=11) "\treturn tmp", + (string) (len=1) "}", + (string) "", + (string) (len=41) "var _Enum64bitMap = map[Enum64bit]string{", + (string) (len=39) "\tEnum64bitUnknown: _Enum64bitName[0:7],", + (string) (len=40) "\tEnum64bitE2P15: _Enum64bitName[7:12],", + (string) (len=41) "\tEnum64bitE2P16: _Enum64bitName[12:17],", + (string) (len=41) "\tEnum64bitE2P17: _Enum64bitName[17:22],", + (string) (len=41) "\tEnum64bitE2P18: _Enum64bitName[22:27],", + (string) (len=41) "\tEnum64bitE2P19: _Enum64bitName[27:32],", + (string) (len=41) "\tEnum64bitE2P20: _Enum64bitName[32:37],", + (string) (len=41) "\tEnum64bitE2P21: _Enum64bitName[37:42],", + (string) (len=41) "\tEnum64bitE2P22: _Enum64bitName[42:47],", + (string) (len=41) "\tEnum64bitE2P23: _Enum64bitName[47:52],", + (string) (len=41) "\tEnum64bitE2P28: _Enum64bitName[52:57],", + (string) (len=41) "\tEnum64bitE2P30: _Enum64bitName[57:62],", + (string) (len=41) "\tEnum64bitE2P31: _Enum64bitName[62:67],", + (string) (len=41) "\tEnum64bitE2P32: _Enum64bitName[67:72],", + (string) (len=41) "\tEnum64bitE2P33: _Enum64bitName[72:77],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=36) "func (x Enum64bit) String() string {", + (string) (len=37) "\tif str, ok := _Enum64bitMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=39) "\treturn fmt.Sprintf(\"Enum64bit(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=43) "var _Enum64bitValue = map[string]Enum64bit{", + (string) (len=58) "\t_Enum64bitName[0:7]: Enum64bitUnknown,", + (string) (len=58) "\tstrings.ToLower(_Enum64bitName[0:7]): Enum64bitUnknown,", + (string) (len=56) "\t_Enum64bitName[7:12]: Enum64bitE2P15,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[7:12]): Enum64bitE2P15,", + (string) (len=56) "\t_Enum64bitName[12:17]: Enum64bitE2P16,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[12:17]): Enum64bitE2P16,", + (string) (len=56) "\t_Enum64bitName[17:22]: Enum64bitE2P17,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[17:22]): Enum64bitE2P17,", + (string) (len=56) "\t_Enum64bitName[22:27]: Enum64bitE2P18,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[22:27]): Enum64bitE2P18,", + (string) (len=56) "\t_Enum64bitName[27:32]: Enum64bitE2P19,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[27:32]): Enum64bitE2P19,", + (string) (len=56) "\t_Enum64bitName[32:37]: Enum64bitE2P20,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[32:37]): Enum64bitE2P20,", + (string) (len=56) "\t_Enum64bitName[37:42]: Enum64bitE2P21,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[37:42]): Enum64bitE2P21,", + (string) (len=56) "\t_Enum64bitName[42:47]: Enum64bitE2P22,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[42:47]): Enum64bitE2P22,", + (string) (len=56) "\t_Enum64bitName[47:52]: Enum64bitE2P23,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[47:52]): Enum64bitE2P23,", + (string) (len=56) "\t_Enum64bitName[52:57]: Enum64bitE2P28,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[52:57]): Enum64bitE2P28,", + (string) (len=56) "\t_Enum64bitName[57:62]: Enum64bitE2P30,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[57:62]): Enum64bitE2P30,", + (string) (len=56) "\t_Enum64bitName[62:67]: Enum64bitE2P31,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[62:67]): Enum64bitE2P31,", + (string) (len=56) "\t_Enum64bitName[67:72]: Enum64bitE2P32,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[67:72]): Enum64bitE2P32,", + (string) (len=56) "\t_Enum64bitName[72:77]: Enum64bitE2P33,", + (string) (len=56) "\tstrings.ToLower(_Enum64bitName[72:77]): Enum64bitE2P33,", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// ParseEnum64bit attempts to convert a string to a Enum64bit.", + (string) (len=53) "func ParseEnum64bit(name string) (Enum64bit, error) {", + (string) (len=40) "\tif x, ok := _Enum64bitValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.", + (string) (len=57) "\tif x, ok := _Enum64bitValue[strings.ToLower(name)]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=116) "\treturn Enum64bit(0), fmt.Errorf(\"%s is not a valid Enum64bit, try [%s]\", name, strings.Join(_Enum64bitNames, \", \"))", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=50) "func (x Enum64bit) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=54) "func (x *Enum64bit) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=33) "\ttmp, err := ParseEnum64bit(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=96) "var _Enum64bitErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=57) "func (x *Enum64bit) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=19) "\t\t*x = Enum64bit(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=19) "\t\t*x = Enum64bit(v)", + (string) (len=13) "\tcase string:", + (string) (len=29) "\t\t*x, err = ParseEnum64bit(v)", + (string) (len=13) "\tcase []byte:", + (string) (len=37) "\t\t*x, err = ParseEnum64bit(string(v))", + (string) (len=16) "\tcase Enum64bit:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=19) "\t\t*x = Enum64bit(v)", + (string) (len=17) "\tcase *Enum64bit:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=19) "\t\t*x = Enum64bit(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=19) "\t\t*x = Enum64bit(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=20) "\t\t*x = Enum64bit(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=20) "\t\t*x = Enum64bit(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=19) "\t\t*x = Enum64bit(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=20) "\t\t*x = Enum64bit(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=20) "\t\t*x = Enum64bit(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=20) "\t\t*x = Enum64bit(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=29) "\t\t\treturn _Enum64bitErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=30) "\t\t*x, err = ParseEnum64bit(*v)", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=50) "func (x Enum64bit) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=42) "\t// ModelToyota is a Model of type Toyota.", + (string) (len=25) "\tModelToyota Model = iota", + (string) (len=18) "\t// Skipped value.", + (string) (len=2) "\t_", + (string) (len=40) "\t// ModelChevy is a Model of type Chevy.", + (string) (len=11) "\tModelChevy", + (string) (len=18) "\t// Skipped value.", + (string) (len=2) "\t_", + (string) (len=38) "\t// ModelFord is a Model of type Ford.", + (string) (len=10) "\tModelFord", + (string) (len=1) ")", + (string) "", + (string) (len=36) "const _ModelName = \"ToyotaChevyFord\"", + (string) "", + (string) (len=27) "var _ModelNames = []string{", + (string) (len=17) "\t_ModelName[0:6],", + (string) (len=18) "\t_ModelName[6:11],", + (string) (len=19) "\t_ModelName[11:15],", + (string) (len=1) "}", + (string) "", + (string) (len=64) "// ModelNames returns a list of possible string values of Model.", + (string) (len=28) "func ModelNames() []string {", + (string) (len=40) "\ttmp := make([]string, len(_ModelNames))", + (string) (len=23) "\tcopy(tmp, _ModelNames)", + (string) (len=11) "\treturn tmp", + (string) (len=1) "}", + (string) "", + (string) (len=33) "var _ModelMap = map[Model]string{", + (string) (len=30) "\tModelToyota: _ModelName[0:6],", + (string) (len=31) "\tModelChevy: _ModelName[6:11],", + (string) (len=32) "\tModelFord: _ModelName[11:15],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=32) "func (x Model) String() string {", + (string) (len=33) "\tif str, ok := _ModelMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=35) "\treturn fmt.Sprintf(\"Model(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=35) "var _ModelValue = map[string]Model{", + (string) (len=49) "\t_ModelName[0:6]: ModelToyota,", + (string) (len=49) "\tstrings.ToLower(_ModelName[0:6]): ModelToyota,", + (string) (len=48) "\t_ModelName[6:11]: ModelChevy,", + (string) (len=48) "\tstrings.ToLower(_ModelName[6:11]): ModelChevy,", + (string) (len=47) "\t_ModelName[11:15]: ModelFord,", + (string) (len=47) "\tstrings.ToLower(_ModelName[11:15]): ModelFord,", + (string) (len=1) "}", + (string) "", + (string) (len=54) "// ParseModel attempts to convert a string to a Model.", + (string) (len=45) "func ParseModel(name string) (Model, error) {", + (string) (len=36) "\tif x, ok := _ModelValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.", + (string) (len=53) "\tif x, ok := _ModelValue[strings.ToLower(name)]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=104) "\treturn Model(0), fmt.Errorf(\"%s is not a valid Model, try [%s]\", name, strings.Join(_ModelNames, \", \"))", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=46) "func (x Model) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=50) "func (x *Model) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=29) "\ttmp, err := ParseModel(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=92) "var _ModelErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=53) "func (x *Model) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=15) "\t\t*x = Model(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=15) "\t\t*x = Model(v)", + (string) (len=13) "\tcase string:", + (string) (len=25) "\t\t*x, err = ParseModel(v)", + (string) (len=13) "\tcase []byte:", + (string) (len=33) "\t\t*x, err = ParseModel(string(v))", + (string) (len=12) "\tcase Model:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=15) "\t\t*x = Model(v)", + (string) (len=13) "\tcase *Model:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=15) "\t\t*x = Model(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=15) "\t\t*x = Model(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Model(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Model(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\t*x = Model(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Model(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Model(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=16) "\t\t*x = Model(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=25) "\t\t\treturn _ModelErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=26) "\t\t*x, err = ParseModel(*v)", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=46) "func (x Model) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=61) "\t// SanitizingTestHyphen is a Sanitizing of type Test-Hyphen.", + (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=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-.", + (string) (len=23) "\tSanitizingEndingHyphen", + (string) (len=1) ")", + (string) "", + (string) (len=112) "const _SanitizingName = \"test-Hyphen-hyphenStart_underscoreFirst0numberFirst123456789a123123-asdfending-hyphen-\"", + (string) "", + (string) (len=32) "var _SanitizingNames = []string{", + (string) (len=23) "\t_SanitizingName[0:11],", + (string) (len=24) "\t_SanitizingName[11:23],", + (string) (len=24) "\t_SanitizingName[23:39],", + (string) (len=24) "\t_SanitizingName[39:51],", + (string) (len=24) "\t_SanitizingName[51:61],", + (string) (len=24) "\t_SanitizingName[61:72],", + (string) (len=24) "\t_SanitizingName[72:86],", + (string) (len=1) "}", + (string) "", + (string) (len=74) "// SanitizingNames returns a list of possible string values of Sanitizing.", + (string) (len=33) "func SanitizingNames() []string {", + (string) (len=45) "\ttmp := make([]string, len(_SanitizingNames))", + (string) (len=28) "\tcopy(tmp, _SanitizingNames)", + (string) (len=11) "\treturn tmp", + (string) (len=1) "}", + (string) "", + (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) "\tSanitizing123123Asdf: _SanitizingName[61:72],", + (string) (len=52) "\tSanitizingEndingHyphen: _SanitizingName[72:86],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=37) "func (x Sanitizing) String() string {", + (string) (len=38) "\tif str, ok := _SanitizingMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=40) "\treturn fmt.Sprintf(\"Sanitizing(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=45) "var _SanitizingValue = map[string]Sanitizing{", + (string) (len=63) "\t_SanitizingName[0:11]: SanitizingTestHyphen,", + (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=63) "\t_SanitizingName[61:72]: Sanitizing123123Asdf,", + (string) (len=63) "\tstrings.ToLower(_SanitizingName[61:72]): Sanitizing123123Asdf,", + (string) (len=65) "\t_SanitizingName[72:86]: SanitizingEndingHyphen,", + (string) (len=65) "\tstrings.ToLower(_SanitizingName[72:86]): SanitizingEndingHyphen,", + (string) (len=1) "}", + (string) "", + (string) (len=64) "// ParseSanitizing attempts to convert a string to a Sanitizing.", + (string) (len=55) "func ParseSanitizing(name string) (Sanitizing, error) {", + (string) (len=41) "\tif x, ok := _SanitizingValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.", + (string) (len=58) "\tif x, ok := _SanitizingValue[strings.ToLower(name)]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=119) "\treturn Sanitizing(0), fmt.Errorf(\"%s is not a valid Sanitizing, try [%s]\", name, strings.Join(_SanitizingNames, \", \"))", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=51) "func (x Sanitizing) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=55) "func (x *Sanitizing) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=34) "\ttmp, err := ParseSanitizing(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=97) "var _SanitizingErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=58) "func (x *Sanitizing) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=20) "\t\t*x = Sanitizing(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=20) "\t\t*x = Sanitizing(v)", + (string) (len=13) "\tcase string:", + (string) (len=30) "\t\t*x, err = ParseSanitizing(v)", + (string) (len=13) "\tcase []byte:", + (string) (len=38) "\t\t*x, err = ParseSanitizing(string(v))", + (string) (len=17) "\tcase Sanitizing:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=20) "\t\t*x = Sanitizing(v)", + (string) (len=18) "\tcase *Sanitizing:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=20) "\t\t*x = Sanitizing(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=20) "\t\t*x = Sanitizing(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = Sanitizing(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = Sanitizing(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=20) "\t\t*x = Sanitizing(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = Sanitizing(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = Sanitizing(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=21) "\t\t*x = Sanitizing(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=30) "\t\t\treturn _SanitizingErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=31) "\t\t*x, err = ParseSanitizing(*v)", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=51) "func (x Sanitizing) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=36) "\t// SodaCoke is a Soda of type Coke.", + (string) (len=21) "\tSodaCoke Soda = iota", + (string) (len=38) "\t// SodaPepsi is a Soda of type Pepsi.", + (string) (len=10) "\tSodaPepsi", + (string) (len=40) "\t// SodaMtnDew is a Soda of type MtnDew.", + (string) (len=11) "\tSodaMtnDew", + (string) (len=1) ")", + (string) "", + (string) (len=35) "const _SodaName = \"CokePepsiMtnDew\"", + (string) "", + (string) (len=26) "var _SodaNames = []string{", + (string) (len=16) "\t_SodaName[0:4],", + (string) (len=16) "\t_SodaName[4:9],", + (string) (len=17) "\t_SodaName[9:15],", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// SodaNames returns a list of possible string values of Soda.", + (string) (len=27) "func SodaNames() []string {", + (string) (len=39) "\ttmp := make([]string, len(_SodaNames))", + (string) (len=22) "\tcopy(tmp, _SodaNames)", + (string) (len=11) "\treturn tmp", + (string) (len=1) "}", + (string) "", + (string) (len=31) "var _SodaMap = map[Soda]string{", + (string) (len=28) "\tSodaCoke: _SodaName[0:4],", + (string) (len=28) "\tSodaPepsi: _SodaName[4:9],", + (string) (len=29) "\tSodaMtnDew: _SodaName[9:15],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=31) "func (x Soda) String() string {", + (string) (len=32) "\tif str, ok := _SodaMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=34) "\treturn fmt.Sprintf(\"Soda(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=33) "var _SodaValue = map[string]Soda{", + (string) (len=44) "\t_SodaName[0:4]: SodaCoke,", + (string) (len=44) "\tstrings.ToLower(_SodaName[0:4]): SodaCoke,", + (string) (len=45) "\t_SodaName[4:9]: SodaPepsi,", + (string) (len=45) "\tstrings.ToLower(_SodaName[4:9]): SodaPepsi,", + (string) (len=46) "\t_SodaName[9:15]: SodaMtnDew,", + (string) (len=46) "\tstrings.ToLower(_SodaName[9:15]): SodaMtnDew,", + (string) (len=1) "}", + (string) "", + (string) (len=52) "// ParseSoda attempts to convert a string to a Soda.", + (string) (len=43) "func ParseSoda(name string) (Soda, error) {", + (string) (len=35) "\tif x, ok := _SodaValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.", + (string) (len=52) "\tif x, ok := _SodaValue[strings.ToLower(name)]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=101) "\treturn Soda(0), fmt.Errorf(\"%s is not a valid Soda, try [%s]\", name, strings.Join(_SodaNames, \", \"))", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=45) "func (x Soda) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=49) "func (x *Soda) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=28) "\ttmp, err := ParseSoda(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=91) "var _SodaErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=52) "func (x *Soda) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=14) "\t\t*x = Soda(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=14) "\t\t*x = Soda(v)", + (string) (len=13) "\tcase string:", + (string) (len=24) "\t\t*x, err = ParseSoda(v)", + (string) (len=13) "\tcase []byte:", + (string) (len=32) "\t\t*x, err = ParseSoda(string(v))", + (string) (len=11) "\tcase Soda:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=14) "\t\t*x = Soda(v)", + (string) (len=12) "\tcase *Soda:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=14) "\t\t*x = Soda(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=14) "\t\t*x = Soda(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=15) "\t\t*x = Soda(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=15) "\t\t*x = Soda(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=14) "\t\t*x = Soda(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=15) "\t\t*x = Soda(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=15) "\t\t*x = Soda(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=15) "\t\t*x = Soda(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=24) "\t\t\treturn _SodaErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=25) "\t\t*x, err = ParseSoda(*v)", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=45) "func (x Soda) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=68) "\t// StartNotZeroStartWithNum is a StartNotZero of type StartWithNum.", + (string) (len=50) "\tStartNotZeroStartWithNum StartNotZero = iota + 23", + (string) (len=58) "\t// StartNotZeroNextNum is a StartNotZero of type NextNum.", + (string) (len=20) "\tStartNotZeroNextNum", + (string) (len=1) ")", + (string) "", + (string) (len=47) "const _StartNotZeroName = \"startWithNumnextNum\"", + (string) "", + (string) (len=34) "var _StartNotZeroNames = []string{", + (string) (len=25) "\t_StartNotZeroName[0:12],", + (string) (len=26) "\t_StartNotZeroName[12:19],", + (string) (len=1) "}", + (string) "", + (string) (len=78) "// StartNotZeroNames returns a list of possible string values of StartNotZero.", + (string) (len=35) "func StartNotZeroNames() []string {", + (string) (len=47) "\ttmp := make([]string, len(_StartNotZeroNames))", + (string) (len=30) "\tcopy(tmp, _StartNotZeroNames)", + (string) (len=11) "\treturn tmp", + (string) (len=1) "}", + (string) "", + (string) (len=47) "var _StartNotZeroMap = map[StartNotZero]string{", + (string) (len=51) "\tStartNotZeroStartWithNum: _StartNotZeroName[0:12],", + (string) (len=52) "\tStartNotZeroNextNum: _StartNotZeroName[12:19],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=39) "func (x StartNotZero) String() string {", + (string) (len=40) "\tif str, ok := _StartNotZeroMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=42) "\treturn fmt.Sprintf(\"StartNotZero(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=49) "var _StartNotZeroValue = map[string]StartNotZero{", + (string) (len=69) "\t_StartNotZeroName[0:12]: StartNotZeroStartWithNum,", + (string) (len=69) "\tstrings.ToLower(_StartNotZeroName[0:12]): StartNotZeroStartWithNum,", + (string) (len=64) "\t_StartNotZeroName[12:19]: StartNotZeroNextNum,", + (string) (len=64) "\tstrings.ToLower(_StartNotZeroName[12:19]): StartNotZeroNextNum,", + (string) (len=1) "}", + (string) "", + (string) (len=68) "// ParseStartNotZero attempts to convert a string to a StartNotZero.", + (string) (len=59) "func ParseStartNotZero(name string) (StartNotZero, error) {", + (string) (len=43) "\tif x, ok := _StartNotZeroValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=121) "\t// Case insensitive parse, do a separate lookup to prevent unnecessary cost of lowercasing a string if we don't need to.", + (string) (len=60) "\tif x, ok := _StartNotZeroValue[strings.ToLower(name)]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=125) "\treturn StartNotZero(0), fmt.Errorf(\"%s is not a valid StartNotZero, try [%s]\", name, strings.Join(_StartNotZeroNames, \", \"))", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=53) "func (x StartNotZero) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=57) "func (x *StartNotZero) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=36) "\ttmp, err := ParseStartNotZero(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=99) "var _StartNotZeroErrNilPtr = errors.New(\"value pointer is nil\") // one per type for package clashes", + (string) "", + (string) (len=41) "// Scan implements the Scanner interface.", + (string) (len=60) "func (x *StartNotZero) Scan(value interface{}) (err error) {", + (string) (len=18) "\tif value == nil {", + (string) (len=22) "\t\t*x = StartNotZero(0)", + (string) (len=8) "\t\treturn", + (string) (len=2) "\t}", + (string) "", + (string) (len=37) "\t// A wider range of scannable types.", + (string) (len=61) "\t// driver.Value values at the top of the list for expediency", + (string) (len=27) "\tswitch v := value.(type) {", + (string) (len=12) "\tcase int64:", + (string) (len=22) "\t\t*x = StartNotZero(v)", + (string) (len=13) "\tcase string:", + (string) (len=32) "\t\t*x, err = ParseStartNotZero(v)", + (string) (len=13) "\tcase []byte:", + (string) (len=40) "\t\t*x, err = ParseStartNotZero(string(v))", + (string) (len=19) "\tcase StartNotZero:", + (string) (len=8) "\t\t*x = v", + (string) (len=10) "\tcase int:", + (string) (len=22) "\t\t*x = StartNotZero(v)", + (string) (len=20) "\tcase *StartNotZero:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=9) "\t\t*x = *v", + (string) (len=11) "\tcase uint:", + (string) (len=22) "\t\t*x = StartNotZero(v)", + (string) (len=13) "\tcase uint64:", + (string) (len=22) "\t\t*x = StartNotZero(v)", + (string) (len=11) "\tcase *int:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=23) "\t\t*x = StartNotZero(*v)", + (string) (len=13) "\tcase *int64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=23) "\t\t*x = StartNotZero(*v)", + (string) (len=72) "\tcase float64: // json marshals everything as a float64 if it's a number", + (string) (len=22) "\t\t*x = StartNotZero(v)", + (string) (len=73) "\tcase *float64: // json marshals everything as a float64 if it's a number", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=23) "\t\t*x = StartNotZero(*v)", + (string) (len=12) "\tcase *uint:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=23) "\t\t*x = StartNotZero(*v)", + (string) (len=14) "\tcase *uint64:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=23) "\t\t*x = StartNotZero(*v)", + (string) (len=14) "\tcase *string:", + (string) (len=15) "\t\tif v == nil {", + (string) (len=32) "\t\t\treturn _StartNotZeroErrNilPtr", + (string) (len=3) "\t\t}", + (string) (len=33) "\t\t*x, err = ParseStartNotZero(*v)", + (string) (len=2) "\t}", + (string) "", + (string) (len=7) "\treturn", + (string) (len=1) "}", + (string) "", + (string) (len=48) "// Value implements the driver Valuer interface.", + (string) (len=53) "func (x StartNotZero) Value() (driver.Value, error) {", + (string) (len=23) "\treturn x.String(), nil", + (string) (len=1) "}", + (string) "" +} diff --git a/generator/.snapshots/TestNoPrefixExampleFile b/generator/.snapshots/TestNoPrefixExampleFile new file mode 100644 index 00000000..4834ad98 --- /dev/null +++ b/generator/.snapshots/TestNoPrefixExampleFile @@ -0,0 +1,1130 @@ +([]string) (len=1128) { + (string) (len=41) "// Code generated by go-enum DO NOT EDIT.", + (string) (len=13) "// Version: -", + (string) (len=14) "// Revision: -", + (string) (len=16) "// Build Date: -", + (string) (len=14) "// Built By: -", + (string) "", + (string) (len=17) "package generator", + (string) "", + (string) (len=8) "import (", + (string) (len=6) "\t\"fmt\"", + (string) (len=10) "\t\"strings\"", + (string) (len=1) ")", + (string) "", + (string) (len=7) "const (", + (string) (len=32) "\t// Cat is a Animal of type Cat.", + (string) (len=18) "\tCat Animal = iota", + (string) (len=32) "\t// Dog is a Animal of type Dog.", + (string) (len=4) "\tDog", + (string) (len=34) "\t// Fish is a Animal of type Fish.", + (string) (len=5) "\tFish", + (string) (len=1) ")", + (string) "", + (string) (len=32) "const _AnimalName = \"CatDogFish\"", + (string) "", + (string) (len=35) "var _AnimalMap = map[Animal]string{", + (string) (len=24) "\tCat: _AnimalName[0:3],", + (string) (len=24) "\tDog: _AnimalName[3:6],", + (string) (len=25) "\tFish: _AnimalName[6:10],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=33) "func (x Animal) String() string {", + (string) (len=34) "\tif str, ok := _AnimalMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=36) "\treturn fmt.Sprintf(\"Animal(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=37) "var _AnimalValue = map[string]Animal{", + (string) (len=41) "\t_AnimalName[0:3]: Cat,", + (string) (len=41) "\tstrings.ToLower(_AnimalName[0:3]): Cat,", + (string) (len=41) "\t_AnimalName[3:6]: Dog,", + (string) (len=41) "\tstrings.ToLower(_AnimalName[3:6]): Dog,", + (string) (len=42) "\t_AnimalName[6:10]: Fish,", + (string) (len=42) "\tstrings.ToLower(_AnimalName[6:10]): Fish,", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// ParseAnimal attempts to convert a string to a Animal.", + (string) (len=47) "func ParseAnimal(name string) (Animal, error) {", + (string) (len=37) "\tif x, ok := _AnimalValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=63) "\treturn Animal(0), fmt.Errorf(\"%s is not a valid Animal\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=47) "func (x Animal) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=51) "func (x *Animal) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=30) "\ttmp, err := ParseAnimal(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=40) "func (x *Animal) Set(val string) error {", + (string) (len=27) "\tv, err := ParseAnimal(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=36) "func (x *Animal) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=32) "func (x *Animal) Type() string {", + (string) (len=16) "\treturn \"Animal\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=45) "\t// Test_lower is a Cases of type Test_lower.", + (string) (len=24) "\tTest_lower Cases = iota", + (string) (len=49) "\t// Test_capital is a Cases of type Test_capital.", + (string) (len=13) "\tTest_capital", + (string) (len=67) "\t// AnotherLowerCaseStart is a Cases of type AnotherLowerCaseStart.", + (string) (len=22) "\tAnotherLowerCaseStart", + (string) (len=1) ")", + (string) "", + (string) (len=64) "const _CasesName = \"test_lowerTest_capitalanotherLowerCaseStart\"", + (string) "", + (string) (len=33) "var _CasesMap = map[Cases]string{", + (string) (len=41) "\tTest_lower: _CasesName[0:10],", + (string) (len=42) "\tTest_capital: _CasesName[10:22],", + (string) (len=42) "\tAnotherLowerCaseStart: _CasesName[22:43],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=32) "func (x Cases) String() string {", + (string) (len=33) "\tif str, ok := _CasesMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=35) "\treturn fmt.Sprintf(\"Cases(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=35) "var _CasesValue = map[string]Cases{", + (string) (len=48) "\t_CasesName[0:10]: Test_lower,", + (string) (len=48) "\tstrings.ToLower(_CasesName[0:10]): Test_lower,", + (string) (len=50) "\t_CasesName[10:22]: Test_capital,", + (string) (len=50) "\tstrings.ToLower(_CasesName[10:22]): Test_capital,", + (string) (len=59) "\t_CasesName[22:43]: AnotherLowerCaseStart,", + (string) (len=59) "\tstrings.ToLower(_CasesName[22:43]): AnotherLowerCaseStart,", + (string) (len=1) "}", + (string) "", + (string) (len=54) "// ParseCases attempts to convert a string to a Cases.", + (string) (len=45) "func ParseCases(name string) (Cases, error) {", + (string) (len=36) "\tif x, ok := _CasesValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=61) "\treturn Cases(0), fmt.Errorf(\"%s is not a valid Cases\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=46) "func (x Cases) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=50) "func (x *Cases) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=29) "\ttmp, err := ParseCases(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=39) "func (x *Cases) Set(val string) error {", + (string) (len=26) "\tv, err := ParseCases(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=35) "func (x *Cases) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=31) "func (x *Cases) Type() string {", + (string) (len=15) "\treturn \"Cases\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=35) "\t// Black is a Color of type Black.", + (string) (len=19) "\tBlack Color = iota", + (string) (len=35) "\t// White is a Color of type White.", + (string) (len=6) "\tWhite", + (string) (len=31) "\t// Red is a Color of type Red.", + (string) (len=4) "\tRed", + (string) (len=35) "\t// Green is a Color of type Green.", + (string) (len=6) "\tGreen", + (string) (len=33) "\t// Blue is a Color of type Blue.", + (string) (len=23) "\tBlue Color = iota + 29", + (string) (len=33) "\t// Grey is a Color of type Grey.", + (string) (len=5) "\tGrey", + (string) (len=37) "\t// Yellow is a Color of type Yellow.", + (string) (len=7) "\tYellow", + (string) (len=1) ")", + (string) "", + (string) (len=53) "const _ColorName = \"BlackWhiteRedGreenBluegreyyellow\"", + (string) "", + (string) (len=33) "var _ColorMap = map[Color]string{", + (string) (len=25) "\tBlack: _ColorName[0:5],", + (string) (len=26) "\tWhite: _ColorName[5:10],", + (string) (len=27) "\tRed: _ColorName[10:13],", + (string) (len=27) "\tGreen: _ColorName[13:18],", + (string) (len=27) "\tBlue: _ColorName[18:22],", + (string) (len=27) "\tGrey: _ColorName[22:26],", + (string) (len=27) "\tYellow: _ColorName[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=32) "func (x Color) String() string {", + (string) (len=33) "\tif str, ok := _ColorMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=35) "\treturn fmt.Sprintf(\"Color(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=35) "var _ColorValue = map[string]Color{", + (string) (len=43) "\t_ColorName[0:5]: Black,", + (string) (len=43) "\tstrings.ToLower(_ColorName[0:5]): Black,", + (string) (len=43) "\t_ColorName[5:10]: White,", + (string) (len=43) "\tstrings.ToLower(_ColorName[5:10]): White,", + (string) (len=41) "\t_ColorName[10:13]: Red,", + (string) (len=41) "\tstrings.ToLower(_ColorName[10:13]): Red,", + (string) (len=43) "\t_ColorName[13:18]: Green,", + (string) (len=43) "\tstrings.ToLower(_ColorName[13:18]): Green,", + (string) (len=42) "\t_ColorName[18:22]: Blue,", + (string) (len=42) "\tstrings.ToLower(_ColorName[18:22]): Blue,", + (string) (len=42) "\t_ColorName[22:26]: Grey,", + (string) (len=42) "\tstrings.ToLower(_ColorName[22:26]): Grey,", + (string) (len=44) "\t_ColorName[26:32]: Yellow,", + (string) (len=44) "\tstrings.ToLower(_ColorName[26:32]): Yellow,", + (string) (len=1) "}", + (string) "", + (string) (len=54) "// ParseColor attempts to convert a string to a Color.", + (string) (len=45) "func ParseColor(name string) (Color, error) {", + (string) (len=36) "\tif x, ok := _ColorValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=61) "\treturn Color(0), fmt.Errorf(\"%s is not a valid Color\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=46) "func (x Color) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=50) "func (x *Color) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=29) "\ttmp, err := ParseColor(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=39) "func (x *Color) Set(val string) error {", + (string) (len=26) "\tv, err := ParseColor(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=35) "func (x *Color) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=31) "func (x *Color) Type() string {", + (string) (len=15) "\treturn \"Color\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=46) "\t// Black is a ColorWithComment of type Black.", + (string) (len=30) "\tBlack ColorWithComment = iota", + (string) (len=46) "\t// White is a ColorWithComment of type White.", + (string) (len=6) "\tWhite", + (string) (len=42) "\t// Red is a ColorWithComment of type Red.", + (string) (len=4) "\tRed", + (string) (len=46) "\t// Green is a ColorWithComment of type Green.", + (string) (len=6) "\tGreen", + (string) (len=44) "\t// Blue is a ColorWithComment of type Blue.", + (string) (len=23) "\t// Blue starts with 33", + (string) (len=34) "\tBlue ColorWithComment = iota + 29", + (string) (len=44) "\t// Grey is a ColorWithComment of type Grey.", + (string) (len=5) "\tGrey", + (string) (len=48) "\t// Yellow is a ColorWithComment of type Yellow.", + (string) (len=7) "\tYellow", + (string) (len=1) ")", + (string) "", + (string) (len=64) "const _ColorWithCommentName = \"BlackWhiteRedGreenBluegreyyellow\"", + (string) "", + (string) (len=55) "var _ColorWithCommentMap = map[ColorWithComment]string{", + (string) (len=36) "\tBlack: _ColorWithCommentName[0:5],", + (string) (len=37) "\tWhite: _ColorWithCommentName[5:10],", + (string) (len=38) "\tRed: _ColorWithCommentName[10:13],", + (string) (len=38) "\tGreen: _ColorWithCommentName[13:18],", + (string) (len=38) "\tBlue: _ColorWithCommentName[18:22],", + (string) (len=38) "\tGrey: _ColorWithCommentName[22:26],", + (string) (len=38) "\tYellow: _ColorWithCommentName[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=43) "func (x ColorWithComment) String() string {", + (string) (len=44) "\tif str, ok := _ColorWithCommentMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=46) "\treturn fmt.Sprintf(\"ColorWithComment(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=57) "var _ColorWithCommentValue = map[string]ColorWithComment{", + (string) (len=54) "\t_ColorWithCommentName[0:5]: Black,", + (string) (len=54) "\tstrings.ToLower(_ColorWithCommentName[0:5]): Black,", + (string) (len=54) "\t_ColorWithCommentName[5:10]: White,", + (string) (len=54) "\tstrings.ToLower(_ColorWithCommentName[5:10]): White,", + (string) (len=52) "\t_ColorWithCommentName[10:13]: Red,", + (string) (len=52) "\tstrings.ToLower(_ColorWithCommentName[10:13]): Red,", + (string) (len=54) "\t_ColorWithCommentName[13:18]: Green,", + (string) (len=54) "\tstrings.ToLower(_ColorWithCommentName[13:18]): Green,", + (string) (len=53) "\t_ColorWithCommentName[18:22]: Blue,", + (string) (len=53) "\tstrings.ToLower(_ColorWithCommentName[18:22]): Blue,", + (string) (len=53) "\t_ColorWithCommentName[22:26]: Grey,", + (string) (len=53) "\tstrings.ToLower(_ColorWithCommentName[22:26]): Grey,", + (string) (len=55) "\t_ColorWithCommentName[26:32]: Yellow,", + (string) (len=55) "\tstrings.ToLower(_ColorWithCommentName[26:32]): Yellow,", + (string) (len=1) "}", + (string) "", + (string) (len=76) "// ParseColorWithComment attempts to convert a string to a ColorWithComment.", + (string) (len=67) "func ParseColorWithComment(name string) (ColorWithComment, error) {", + (string) (len=47) "\tif x, ok := _ColorWithCommentValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=83) "\treturn ColorWithComment(0), fmt.Errorf(\"%s is not a valid ColorWithComment\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=57) "func (x ColorWithComment) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=61) "func (x *ColorWithComment) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=40) "\ttmp, err := ParseColorWithComment(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=50) "func (x *ColorWithComment) Set(val string) error {", + (string) (len=37) "\tv, err := ParseColorWithComment(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=46) "func (x *ColorWithComment) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=42) "func (x *ColorWithComment) Type() string {", + (string) (len=26) "\treturn \"ColorWithComment\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=47) "\t// Black is a ColorWithComment2 of type Black.", + (string) (len=31) "\tBlack ColorWithComment2 = iota", + (string) (len=47) "\t// White is a ColorWithComment2 of type White.", + (string) (len=6) "\tWhite", + (string) (len=43) "\t// Red is a ColorWithComment2 of type Red.", + (string) (len=4) "\tRed", + (string) (len=47) "\t// Green is a ColorWithComment2 of type Green.", + (string) (len=6) "\tGreen", + (string) (len=45) "\t// Blue is a ColorWithComment2 of type Blue.", + (string) (len=23) "\t// Blue starts with 33", + (string) (len=35) "\tBlue ColorWithComment2 = iota + 29", + (string) (len=45) "\t// Grey is a ColorWithComment2 of type Grey.", + (string) (len=5) "\tGrey", + (string) (len=49) "\t// Yellow is a ColorWithComment2 of type Yellow.", + (string) (len=7) "\tYellow", + (string) (len=1) ")", + (string) "", + (string) (len=65) "const _ColorWithComment2Name = \"BlackWhiteRedGreenBluegreyyellow\"", + (string) "", + (string) (len=57) "var _ColorWithComment2Map = map[ColorWithComment2]string{", + (string) (len=37) "\tBlack: _ColorWithComment2Name[0:5],", + (string) (len=38) "\tWhite: _ColorWithComment2Name[5:10],", + (string) (len=39) "\tRed: _ColorWithComment2Name[10:13],", + (string) (len=39) "\tGreen: _ColorWithComment2Name[13:18],", + (string) (len=39) "\tBlue: _ColorWithComment2Name[18:22],", + (string) (len=39) "\tGrey: _ColorWithComment2Name[22:26],", + (string) (len=39) "\tYellow: _ColorWithComment2Name[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=44) "func (x ColorWithComment2) String() string {", + (string) (len=45) "\tif str, ok := _ColorWithComment2Map[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=47) "\treturn fmt.Sprintf(\"ColorWithComment2(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=59) "var _ColorWithComment2Value = map[string]ColorWithComment2{", + (string) (len=55) "\t_ColorWithComment2Name[0:5]: Black,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment2Name[0:5]): Black,", + (string) (len=55) "\t_ColorWithComment2Name[5:10]: White,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment2Name[5:10]): White,", + (string) (len=53) "\t_ColorWithComment2Name[10:13]: Red,", + (string) (len=53) "\tstrings.ToLower(_ColorWithComment2Name[10:13]): Red,", + (string) (len=55) "\t_ColorWithComment2Name[13:18]: Green,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment2Name[13:18]): Green,", + (string) (len=54) "\t_ColorWithComment2Name[18:22]: Blue,", + (string) (len=54) "\tstrings.ToLower(_ColorWithComment2Name[18:22]): Blue,", + (string) (len=54) "\t_ColorWithComment2Name[22:26]: Grey,", + (string) (len=54) "\tstrings.ToLower(_ColorWithComment2Name[22:26]): Grey,", + (string) (len=56) "\t_ColorWithComment2Name[26:32]: Yellow,", + (string) (len=56) "\tstrings.ToLower(_ColorWithComment2Name[26:32]): Yellow,", + (string) (len=1) "}", + (string) "", + (string) (len=78) "// ParseColorWithComment2 attempts to convert a string to a ColorWithComment2.", + (string) (len=69) "func ParseColorWithComment2(name string) (ColorWithComment2, error) {", + (string) (len=48) "\tif x, ok := _ColorWithComment2Value[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=85) "\treturn ColorWithComment2(0), fmt.Errorf(\"%s is not a valid ColorWithComment2\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=58) "func (x ColorWithComment2) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=62) "func (x *ColorWithComment2) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=41) "\ttmp, err := ParseColorWithComment2(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=51) "func (x *ColorWithComment2) Set(val string) error {", + (string) (len=38) "\tv, err := ParseColorWithComment2(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=47) "func (x *ColorWithComment2) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=43) "func (x *ColorWithComment2) Type() string {", + (string) (len=27) "\treturn \"ColorWithComment2\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=47) "\t// Black is a ColorWithComment3 of type Black.", + (string) (len=31) "\tBlack ColorWithComment3 = iota", + (string) (len=47) "\t// White is a ColorWithComment3 of type White.", + (string) (len=6) "\tWhite", + (string) (len=43) "\t// Red is a ColorWithComment3 of type Red.", + (string) (len=4) "\tRed", + (string) (len=47) "\t// Green is a ColorWithComment3 of type Green.", + (string) (len=24) "\t// Green starts with 33", + (string) (len=36) "\tGreen ColorWithComment3 = iota + 30", + (string) (len=45) "\t// Blue is a ColorWithComment3 of type Blue.", + (string) (len=5) "\tBlue", + (string) (len=45) "\t// Grey is a ColorWithComment3 of type Grey.", + (string) (len=5) "\tGrey", + (string) (len=49) "\t// Yellow is a ColorWithComment3 of type Yellow.", + (string) (len=7) "\tYellow", + (string) (len=56) "\t// BlueGreen is a ColorWithComment3 of type Blue-Green.", + (string) (len=22) "\t// blue-green comment", + (string) (len=10) "\tBlueGreen", + (string) (len=56) "\t// RedOrange is a ColorWithComment3 of type Red-Orange.", + (string) (len=10) "\tRedOrange", + (string) (len=65) "\t// RedOrangeBlue is a ColorWithComment3 of type Red-Orange-Blue.", + (string) (len=14) "\tRedOrangeBlue", + (string) (len=1) ")", + (string) "", + (string) (len=100) "const _ColorWithComment3Name = \"BlackWhiteRedGreenBluegreyyellowblue-greenred-orangered-orange-blue\"", + (string) "", + (string) (len=57) "var _ColorWithComment3Map = map[ColorWithComment3]string{", + (string) (len=44) "\tBlack: _ColorWithComment3Name[0:5],", + (string) (len=45) "\tWhite: _ColorWithComment3Name[5:10],", + (string) (len=46) "\tRed: _ColorWithComment3Name[10:13],", + (string) (len=46) "\tGreen: _ColorWithComment3Name[13:18],", + (string) (len=46) "\tBlue: _ColorWithComment3Name[18:22],", + (string) (len=46) "\tGrey: _ColorWithComment3Name[22:26],", + (string) (len=46) "\tYellow: _ColorWithComment3Name[26:32],", + (string) (len=46) "\tBlueGreen: _ColorWithComment3Name[32:42],", + (string) (len=46) "\tRedOrange: _ColorWithComment3Name[42:52],", + (string) (len=46) "\tRedOrangeBlue: _ColorWithComment3Name[52:67],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=44) "func (x ColorWithComment3) String() string {", + (string) (len=45) "\tif str, ok := _ColorWithComment3Map[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=47) "\treturn fmt.Sprintf(\"ColorWithComment3(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=59) "var _ColorWithComment3Value = map[string]ColorWithComment3{", + (string) (len=55) "\t_ColorWithComment3Name[0:5]: Black,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment3Name[0:5]): Black,", + (string) (len=55) "\t_ColorWithComment3Name[5:10]: White,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment3Name[5:10]): White,", + (string) (len=53) "\t_ColorWithComment3Name[10:13]: Red,", + (string) (len=53) "\tstrings.ToLower(_ColorWithComment3Name[10:13]): Red,", + (string) (len=55) "\t_ColorWithComment3Name[13:18]: Green,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment3Name[13:18]): Green,", + (string) (len=54) "\t_ColorWithComment3Name[18:22]: Blue,", + (string) (len=54) "\tstrings.ToLower(_ColorWithComment3Name[18:22]): Blue,", + (string) (len=54) "\t_ColorWithComment3Name[22:26]: Grey,", + (string) (len=54) "\tstrings.ToLower(_ColorWithComment3Name[22:26]): Grey,", + (string) (len=56) "\t_ColorWithComment3Name[26:32]: Yellow,", + (string) (len=56) "\tstrings.ToLower(_ColorWithComment3Name[26:32]): Yellow,", + (string) (len=59) "\t_ColorWithComment3Name[32:42]: BlueGreen,", + (string) (len=59) "\tstrings.ToLower(_ColorWithComment3Name[32:42]): BlueGreen,", + (string) (len=59) "\t_ColorWithComment3Name[42:52]: RedOrange,", + (string) (len=59) "\tstrings.ToLower(_ColorWithComment3Name[42:52]): RedOrange,", + (string) (len=63) "\t_ColorWithComment3Name[52:67]: RedOrangeBlue,", + (string) (len=63) "\tstrings.ToLower(_ColorWithComment3Name[52:67]): RedOrangeBlue,", + (string) (len=1) "}", + (string) "", + (string) (len=78) "// ParseColorWithComment3 attempts to convert a string to a ColorWithComment3.", + (string) (len=69) "func ParseColorWithComment3(name string) (ColorWithComment3, error) {", + (string) (len=48) "\tif x, ok := _ColorWithComment3Value[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=85) "\treturn ColorWithComment3(0), fmt.Errorf(\"%s is not a valid ColorWithComment3\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=58) "func (x ColorWithComment3) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=62) "func (x *ColorWithComment3) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=41) "\ttmp, err := ParseColorWithComment3(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=51) "func (x *ColorWithComment3) Set(val string) error {", + (string) (len=38) "\tv, err := ParseColorWithComment3(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=47) "func (x *ColorWithComment3) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=43) "func (x *ColorWithComment3) Type() string {", + (string) (len=27) "\treturn \"ColorWithComment3\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=18) "\t// Skipped value.", + (string) (len=15) "\t// Placeholder", + (string) (len=27) "\t_ ColorWithComment4 = iota", + (string) (len=47) "\t// Black is a ColorWithComment4 of type Black.", + (string) (len=6) "\tBlack", + (string) (len=47) "\t// White is a ColorWithComment4 of type White.", + (string) (len=6) "\tWhite", + (string) (len=43) "\t// Red is a ColorWithComment4 of type Red.", + (string) (len=4) "\tRed", + (string) (len=47) "\t// Green is a ColorWithComment4 of type Green.", + (string) (len=24) "\t// Green starts with 33", + (string) (len=36) "\tGreen ColorWithComment4 = iota + 29", + (string) (len=45) "\t// Blue is a ColorWithComment4 of type Blue.", + (string) (len=5) "\tBlue", + (string) (len=45) "\t// Grey is a ColorWithComment4 of type Grey.", + (string) (len=5) "\tGrey", + (string) (len=49) "\t// Yellow is a ColorWithComment4 of type Yellow.", + (string) (len=110) "\t// Where did all the (somewhat) bad fish go? (something else that goes in parentheses at the end of the line)", + (string) (len=7) "\tYellow", + (string) (len=56) "\t// BlueGreen is a ColorWithComment4 of type Blue-Green.", + (string) (len=22) "\t// blue-green comment", + (string) (len=10) "\tBlueGreen", + (string) (len=56) "\t// RedOrange is a ColorWithComment4 of type Red-Orange.", + (string) (len=20) "\t// has a , in it!?!", + (string) (len=10) "\tRedOrange", + (string) (len=1) ")", + (string) "", + (string) (len=85) "const _ColorWithComment4Name = \"BlackWhiteRedGreenBluegreyyellowblue-greenred-orange\"", + (string) "", + (string) (len=57) "var _ColorWithComment4Map = map[ColorWithComment4]string{", + (string) (len=40) "\tBlack: _ColorWithComment4Name[0:5],", + (string) (len=41) "\tWhite: _ColorWithComment4Name[5:10],", + (string) (len=42) "\tRed: _ColorWithComment4Name[10:13],", + (string) (len=42) "\tGreen: _ColorWithComment4Name[13:18],", + (string) (len=42) "\tBlue: _ColorWithComment4Name[18:22],", + (string) (len=42) "\tGrey: _ColorWithComment4Name[22:26],", + (string) (len=42) "\tYellow: _ColorWithComment4Name[26:32],", + (string) (len=42) "\tBlueGreen: _ColorWithComment4Name[32:42],", + (string) (len=42) "\tRedOrange: _ColorWithComment4Name[42:52],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=44) "func (x ColorWithComment4) String() string {", + (string) (len=45) "\tif str, ok := _ColorWithComment4Map[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=47) "\treturn fmt.Sprintf(\"ColorWithComment4(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=59) "var _ColorWithComment4Value = map[string]ColorWithComment4{", + (string) (len=55) "\t_ColorWithComment4Name[0:5]: Black,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment4Name[0:5]): Black,", + (string) (len=55) "\t_ColorWithComment4Name[5:10]: White,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment4Name[5:10]): White,", + (string) (len=53) "\t_ColorWithComment4Name[10:13]: Red,", + (string) (len=53) "\tstrings.ToLower(_ColorWithComment4Name[10:13]): Red,", + (string) (len=55) "\t_ColorWithComment4Name[13:18]: Green,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment4Name[13:18]): Green,", + (string) (len=54) "\t_ColorWithComment4Name[18:22]: Blue,", + (string) (len=54) "\tstrings.ToLower(_ColorWithComment4Name[18:22]): Blue,", + (string) (len=54) "\t_ColorWithComment4Name[22:26]: Grey,", + (string) (len=54) "\tstrings.ToLower(_ColorWithComment4Name[22:26]): Grey,", + (string) (len=56) "\t_ColorWithComment4Name[26:32]: Yellow,", + (string) (len=56) "\tstrings.ToLower(_ColorWithComment4Name[26:32]): Yellow,", + (string) (len=59) "\t_ColorWithComment4Name[32:42]: BlueGreen,", + (string) (len=59) "\tstrings.ToLower(_ColorWithComment4Name[32:42]): BlueGreen,", + (string) (len=59) "\t_ColorWithComment4Name[42:52]: RedOrange,", + (string) (len=59) "\tstrings.ToLower(_ColorWithComment4Name[42:52]): RedOrange,", + (string) (len=1) "}", + (string) "", + (string) (len=78) "// ParseColorWithComment4 attempts to convert a string to a ColorWithComment4.", + (string) (len=69) "func ParseColorWithComment4(name string) (ColorWithComment4, error) {", + (string) (len=48) "\tif x, ok := _ColorWithComment4Value[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=85) "\treturn ColorWithComment4(0), fmt.Errorf(\"%s is not a valid ColorWithComment4\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=58) "func (x ColorWithComment4) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=62) "func (x *ColorWithComment4) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=41) "\ttmp, err := ParseColorWithComment4(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=51) "func (x *ColorWithComment4) Set(val string) error {", + (string) (len=38) "\tv, err := ParseColorWithComment4(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=47) "func (x *ColorWithComment4) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=43) "func (x *ColorWithComment4) Type() string {", + (string) (len=27) "\treturn \"ColorWithComment4\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=43) "\t// Unknown is a Enum64bit of type Unknown.", + (string) (len=25) "\tUnknown Enum64bit = iota", + (string) (len=39) "\t// E2P15 is a Enum64bit of type E2P15.", + (string) (len=31) "\tE2P15 Enum64bit = iota + 32767", + (string) (len=39) "\t// E2P16 is a Enum64bit of type E2P16.", + (string) (len=31) "\tE2P16 Enum64bit = iota + 65534", + (string) (len=39) "\t// E2P17 is a Enum64bit of type E2P17.", + (string) (len=32) "\tE2P17 Enum64bit = iota + 131069", + (string) (len=39) "\t// E2P18 is a Enum64bit of type E2P18.", + (string) (len=32) "\tE2P18 Enum64bit = iota + 262140", + (string) (len=39) "\t// E2P19 is a Enum64bit of type E2P19.", + (string) (len=32) "\tE2P19 Enum64bit = iota + 524283", + (string) (len=39) "\t// E2P20 is a Enum64bit of type E2P20.", + (string) (len=33) "\tE2P20 Enum64bit = iota + 1048570", + (string) (len=39) "\t// E2P21 is a Enum64bit of type E2P21.", + (string) (len=33) "\tE2P21 Enum64bit = iota + 2097145", + (string) (len=39) "\t// E2P22 is a Enum64bit of type E2P22.", + (string) (len=34) "\tE2P22 Enum64bit = iota + 33554424", + (string) (len=39) "\t// E2P23 is a Enum64bit of type E2P23.", + (string) (len=34) "\tE2P23 Enum64bit = iota + 67108855", + (string) (len=39) "\t// E2P28 is a Enum64bit of type E2P28.", + (string) (len=35) "\tE2P28 Enum64bit = iota + 536870902", + (string) (len=39) "\t// E2P30 is a Enum64bit of type E2P30.", + (string) (len=36) "\tE2P30 Enum64bit = iota + 1073741813", + (string) (len=39) "\t// E2P31 is a Enum64bit of type E2P31.", + (string) (len=36) "\tE2P31 Enum64bit = iota + 2147483636", + (string) (len=39) "\t// E2P32 is a Enum64bit of type E2P32.", + (string) (len=36) "\tE2P32 Enum64bit = iota + 4294967283", + (string) (len=39) "\t// E2P33 is a Enum64bit of type E2P33.", + (string) (len=36) "\tE2P33 Enum64bit = iota + 8454967282", + (string) (len=1) ")", + (string) "", + (string) (len=102) "const _Enum64bitName = \"UnknownE2P15E2P16E2P17E2P18E2P19E2P20E2P21E2P22E2P23E2P28E2P30E2P31E2P32E2P33\"", + (string) "", + (string) (len=41) "var _Enum64bitMap = map[Enum64bit]string{", + (string) (len=30) "\tUnknown: _Enum64bitName[0:7],", + (string) (len=31) "\tE2P15: _Enum64bitName[7:12],", + (string) (len=32) "\tE2P16: _Enum64bitName[12:17],", + (string) (len=32) "\tE2P17: _Enum64bitName[17:22],", + (string) (len=32) "\tE2P18: _Enum64bitName[22:27],", + (string) (len=32) "\tE2P19: _Enum64bitName[27:32],", + (string) (len=32) "\tE2P20: _Enum64bitName[32:37],", + (string) (len=32) "\tE2P21: _Enum64bitName[37:42],", + (string) (len=32) "\tE2P22: _Enum64bitName[42:47],", + (string) (len=32) "\tE2P23: _Enum64bitName[47:52],", + (string) (len=32) "\tE2P28: _Enum64bitName[52:57],", + (string) (len=32) "\tE2P30: _Enum64bitName[57:62],", + (string) (len=32) "\tE2P31: _Enum64bitName[62:67],", + (string) (len=32) "\tE2P32: _Enum64bitName[67:72],", + (string) (len=32) "\tE2P33: _Enum64bitName[72:77],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=36) "func (x Enum64bit) String() string {", + (string) (len=37) "\tif str, ok := _Enum64bitMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=39) "\treturn fmt.Sprintf(\"Enum64bit(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=43) "var _Enum64bitValue = map[string]Enum64bit{", + (string) (len=49) "\t_Enum64bitName[0:7]: Unknown,", + (string) (len=49) "\tstrings.ToLower(_Enum64bitName[0:7]): Unknown,", + (string) (len=47) "\t_Enum64bitName[7:12]: E2P15,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[7:12]): E2P15,", + (string) (len=47) "\t_Enum64bitName[12:17]: E2P16,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[12:17]): E2P16,", + (string) (len=47) "\t_Enum64bitName[17:22]: E2P17,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[17:22]): E2P17,", + (string) (len=47) "\t_Enum64bitName[22:27]: E2P18,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[22:27]): E2P18,", + (string) (len=47) "\t_Enum64bitName[27:32]: E2P19,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[27:32]): E2P19,", + (string) (len=47) "\t_Enum64bitName[32:37]: E2P20,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[32:37]): E2P20,", + (string) (len=47) "\t_Enum64bitName[37:42]: E2P21,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[37:42]): E2P21,", + (string) (len=47) "\t_Enum64bitName[42:47]: E2P22,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[42:47]): E2P22,", + (string) (len=47) "\t_Enum64bitName[47:52]: E2P23,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[47:52]): E2P23,", + (string) (len=47) "\t_Enum64bitName[52:57]: E2P28,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[52:57]): E2P28,", + (string) (len=47) "\t_Enum64bitName[57:62]: E2P30,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[57:62]): E2P30,", + (string) (len=47) "\t_Enum64bitName[62:67]: E2P31,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[62:67]): E2P31,", + (string) (len=47) "\t_Enum64bitName[67:72]: E2P32,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[67:72]): E2P32,", + (string) (len=47) "\t_Enum64bitName[72:77]: E2P33,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[72:77]): E2P33,", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// ParseEnum64bit attempts to convert a string to a Enum64bit.", + (string) (len=53) "func ParseEnum64bit(name string) (Enum64bit, error) {", + (string) (len=40) "\tif x, ok := _Enum64bitValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=69) "\treturn Enum64bit(0), fmt.Errorf(\"%s is not a valid Enum64bit\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=50) "func (x Enum64bit) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=54) "func (x *Enum64bit) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=33) "\ttmp, err := ParseEnum64bit(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=43) "func (x *Enum64bit) Set(val string) error {", + (string) (len=30) "\tv, err := ParseEnum64bit(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=39) "func (x *Enum64bit) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=35) "func (x *Enum64bit) Type() string {", + (string) (len=19) "\treturn \"Enum64bit\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=37) "\t// Toyota is a Model of type Toyota.", + (string) (len=20) "\tToyota Model = iota", + (string) (len=18) "\t// Skipped value.", + (string) (len=2) "\t_", + (string) (len=35) "\t// Chevy is a Model of type Chevy.", + (string) (len=6) "\tChevy", + (string) (len=18) "\t// Skipped value.", + (string) (len=2) "\t_", + (string) (len=33) "\t// Ford is a Model of type Ford.", + (string) (len=5) "\tFord", + (string) (len=1) ")", + (string) "", + (string) (len=36) "const _ModelName = \"ToyotaChevyFord\"", + (string) "", + (string) (len=33) "var _ModelMap = map[Model]string{", + (string) (len=25) "\tToyota: _ModelName[0:6],", + (string) (len=26) "\tChevy: _ModelName[6:11],", + (string) (len=27) "\tFord: _ModelName[11:15],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=32) "func (x Model) String() string {", + (string) (len=33) "\tif str, ok := _ModelMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=35) "\treturn fmt.Sprintf(\"Model(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=35) "var _ModelValue = map[string]Model{", + (string) (len=44) "\t_ModelName[0:6]: Toyota,", + (string) (len=44) "\tstrings.ToLower(_ModelName[0:6]): Toyota,", + (string) (len=43) "\t_ModelName[6:11]: Chevy,", + (string) (len=43) "\tstrings.ToLower(_ModelName[6:11]): Chevy,", + (string) (len=42) "\t_ModelName[11:15]: Ford,", + (string) (len=42) "\tstrings.ToLower(_ModelName[11:15]): Ford,", + (string) (len=1) "}", + (string) "", + (string) (len=54) "// ParseModel attempts to convert a string to a Model.", + (string) (len=45) "func ParseModel(name string) (Model, error) {", + (string) (len=36) "\tif x, ok := _ModelValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=61) "\treturn Model(0), fmt.Errorf(\"%s is not a valid Model\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=46) "func (x Model) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=50) "func (x *Model) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=29) "\ttmp, err := ParseModel(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=39) "func (x *Model) Set(val string) error {", + (string) (len=26) "\tv, err := ParseModel(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=35) "func (x *Model) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=31) "func (x *Model) Type() string {", + (string) (len=15) "\treturn \"Model\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=51) "\t// TestHyphen is a Sanitizing of type Test-Hyphen.", + (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=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-.", + (string) (len=13) "\tEndingHyphen", + (string) (len=1) ")", + (string) "", + (string) (len=112) "const _SanitizingName = \"test-Hyphen-hyphenStart_underscoreFirst0numberFirst123456789a123123-asdfending-hyphen-\"", + (string) "", + (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) "\tX123123Asdf: _SanitizingName[61:72],", + (string) (len=43) "\tEndingHyphen: _SanitizingName[72:86],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=37) "func (x Sanitizing) String() string {", + (string) (len=38) "\tif str, ok := _SanitizingMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=40) "\treturn fmt.Sprintf(\"Sanitizing(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=45) "var _SanitizingValue = map[string]Sanitizing{", + (string) (len=53) "\t_SanitizingName[0:11]: TestHyphen,", + (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=54) "\t_SanitizingName[61:72]: X123123Asdf,", + (string) (len=54) "\tstrings.ToLower(_SanitizingName[61:72]): X123123Asdf,", + (string) (len=55) "\t_SanitizingName[72:86]: EndingHyphen,", + (string) (len=55) "\tstrings.ToLower(_SanitizingName[72:86]): EndingHyphen,", + (string) (len=1) "}", + (string) "", + (string) (len=64) "// ParseSanitizing attempts to convert a string to a Sanitizing.", + (string) (len=55) "func ParseSanitizing(name string) (Sanitizing, error) {", + (string) (len=41) "\tif x, ok := _SanitizingValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=71) "\treturn Sanitizing(0), fmt.Errorf(\"%s is not a valid Sanitizing\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=51) "func (x Sanitizing) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=55) "func (x *Sanitizing) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=34) "\ttmp, err := ParseSanitizing(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=44) "func (x *Sanitizing) Set(val string) error {", + (string) (len=31) "\tv, err := ParseSanitizing(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=40) "func (x *Sanitizing) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=36) "func (x *Sanitizing) Type() string {", + (string) (len=20) "\treturn \"Sanitizing\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=32) "\t// Coke is a Soda of type Coke.", + (string) (len=17) "\tCoke Soda = iota", + (string) (len=34) "\t// Pepsi is a Soda of type Pepsi.", + (string) (len=6) "\tPepsi", + (string) (len=36) "\t// MtnDew is a Soda of type MtnDew.", + (string) (len=7) "\tMtnDew", + (string) (len=1) ")", + (string) "", + (string) (len=35) "const _SodaName = \"CokePepsiMtnDew\"", + (string) "", + (string) (len=31) "var _SodaMap = map[Soda]string{", + (string) (len=24) "\tCoke: _SodaName[0:4],", + (string) (len=24) "\tPepsi: _SodaName[4:9],", + (string) (len=25) "\tMtnDew: _SodaName[9:15],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=31) "func (x Soda) String() string {", + (string) (len=32) "\tif str, ok := _SodaMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=34) "\treturn fmt.Sprintf(\"Soda(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=33) "var _SodaValue = map[string]Soda{", + (string) (len=40) "\t_SodaName[0:4]: Coke,", + (string) (len=40) "\tstrings.ToLower(_SodaName[0:4]): Coke,", + (string) (len=41) "\t_SodaName[4:9]: Pepsi,", + (string) (len=41) "\tstrings.ToLower(_SodaName[4:9]): Pepsi,", + (string) (len=42) "\t_SodaName[9:15]: MtnDew,", + (string) (len=42) "\tstrings.ToLower(_SodaName[9:15]): MtnDew,", + (string) (len=1) "}", + (string) "", + (string) (len=52) "// ParseSoda attempts to convert a string to a Soda.", + (string) (len=43) "func ParseSoda(name string) (Soda, error) {", + (string) (len=35) "\tif x, ok := _SodaValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=59) "\treturn Soda(0), fmt.Errorf(\"%s is not a valid Soda\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=45) "func (x Soda) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=49) "func (x *Soda) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=28) "\ttmp, err := ParseSoda(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=38) "func (x *Soda) Set(val string) error {", + (string) (len=25) "\tv, err := ParseSoda(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=34) "func (x *Soda) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=30) "func (x *Soda) Type() string {", + (string) (len=14) "\treturn \"Soda\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=56) "\t// StartWithNum is a StartNotZero of type StartWithNum.", + (string) (len=38) "\tStartWithNum StartNotZero = iota + 23", + (string) (len=46) "\t// NextNum is a StartNotZero of type NextNum.", + (string) (len=8) "\tNextNum", + (string) (len=1) ")", + (string) "", + (string) (len=47) "const _StartNotZeroName = \"startWithNumnextNum\"", + (string) "", + (string) (len=47) "var _StartNotZeroMap = map[StartNotZero]string{", + (string) (len=39) "\tStartWithNum: _StartNotZeroName[0:12],", + (string) (len=40) "\tNextNum: _StartNotZeroName[12:19],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=39) "func (x StartNotZero) String() string {", + (string) (len=40) "\tif str, ok := _StartNotZeroMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=42) "\treturn fmt.Sprintf(\"StartNotZero(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=49) "var _StartNotZeroValue = map[string]StartNotZero{", + (string) (len=57) "\t_StartNotZeroName[0:12]: StartWithNum,", + (string) (len=57) "\tstrings.ToLower(_StartNotZeroName[0:12]): StartWithNum,", + (string) (len=52) "\t_StartNotZeroName[12:19]: NextNum,", + (string) (len=52) "\tstrings.ToLower(_StartNotZeroName[12:19]): NextNum,", + (string) (len=1) "}", + (string) "", + (string) (len=68) "// ParseStartNotZero attempts to convert a string to a StartNotZero.", + (string) (len=59) "func ParseStartNotZero(name string) (StartNotZero, error) {", + (string) (len=43) "\tif x, ok := _StartNotZeroValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=75) "\treturn StartNotZero(0), fmt.Errorf(\"%s is not a valid StartNotZero\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=53) "func (x StartNotZero) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=57) "func (x *StartNotZero) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=36) "\ttmp, err := ParseStartNotZero(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=46) "func (x *StartNotZero) Set(val string) error {", + (string) (len=33) "\tv, err := ParseStartNotZero(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=42) "func (x *StartNotZero) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=38) "func (x *StartNotZero) Type() string {", + (string) (len=22) "\treturn \"StartNotZero\"", + (string) (len=1) "}", + (string) "" +} diff --git a/generator/.snapshots/TestNoPrefixExampleFileWithSnakeToCamel b/generator/.snapshots/TestNoPrefixExampleFileWithSnakeToCamel new file mode 100644 index 00000000..e920dd2e --- /dev/null +++ b/generator/.snapshots/TestNoPrefixExampleFileWithSnakeToCamel @@ -0,0 +1,1130 @@ +([]string) (len=1128) { + (string) (len=41) "// Code generated by go-enum DO NOT EDIT.", + (string) (len=13) "// Version: -", + (string) (len=14) "// Revision: -", + (string) (len=16) "// Build Date: -", + (string) (len=14) "// Built By: -", + (string) "", + (string) (len=17) "package generator", + (string) "", + (string) (len=8) "import (", + (string) (len=6) "\t\"fmt\"", + (string) (len=10) "\t\"strings\"", + (string) (len=1) ")", + (string) "", + (string) (len=7) "const (", + (string) (len=32) "\t// Cat is a Animal of type Cat.", + (string) (len=18) "\tCat Animal = iota", + (string) (len=32) "\t// Dog is a Animal of type Dog.", + (string) (len=4) "\tDog", + (string) (len=34) "\t// Fish is a Animal of type Fish.", + (string) (len=5) "\tFish", + (string) (len=1) ")", + (string) "", + (string) (len=32) "const _AnimalName = \"CatDogFish\"", + (string) "", + (string) (len=35) "var _AnimalMap = map[Animal]string{", + (string) (len=24) "\tCat: _AnimalName[0:3],", + (string) (len=24) "\tDog: _AnimalName[3:6],", + (string) (len=25) "\tFish: _AnimalName[6:10],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=33) "func (x Animal) String() string {", + (string) (len=34) "\tif str, ok := _AnimalMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=36) "\treturn fmt.Sprintf(\"Animal(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=37) "var _AnimalValue = map[string]Animal{", + (string) (len=41) "\t_AnimalName[0:3]: Cat,", + (string) (len=41) "\tstrings.ToLower(_AnimalName[0:3]): Cat,", + (string) (len=41) "\t_AnimalName[3:6]: Dog,", + (string) (len=41) "\tstrings.ToLower(_AnimalName[3:6]): Dog,", + (string) (len=42) "\t_AnimalName[6:10]: Fish,", + (string) (len=42) "\tstrings.ToLower(_AnimalName[6:10]): Fish,", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// ParseAnimal attempts to convert a string to a Animal.", + (string) (len=47) "func ParseAnimal(name string) (Animal, error) {", + (string) (len=37) "\tif x, ok := _AnimalValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=63) "\treturn Animal(0), fmt.Errorf(\"%s is not a valid Animal\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=47) "func (x Animal) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=51) "func (x *Animal) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=30) "\ttmp, err := ParseAnimal(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=40) "func (x *Animal) Set(val string) error {", + (string) (len=27) "\tv, err := ParseAnimal(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=36) "func (x *Animal) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=32) "func (x *Animal) Type() string {", + (string) (len=16) "\treturn \"Animal\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=44) "\t// TestLower is a Cases of type Test_lower.", + (string) (len=23) "\tTestLower Cases = iota", + (string) (len=48) "\t// TestCapital is a Cases of type Test_capital.", + (string) (len=12) "\tTestCapital", + (string) (len=67) "\t// AnotherLowerCaseStart is a Cases of type AnotherLowerCaseStart.", + (string) (len=22) "\tAnotherLowerCaseStart", + (string) (len=1) ")", + (string) "", + (string) (len=64) "const _CasesName = \"test_lowerTest_capitalanotherLowerCaseStart\"", + (string) "", + (string) (len=33) "var _CasesMap = map[Cases]string{", + (string) (len=41) "\tTestLower: _CasesName[0:10],", + (string) (len=42) "\tTestCapital: _CasesName[10:22],", + (string) (len=42) "\tAnotherLowerCaseStart: _CasesName[22:43],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=32) "func (x Cases) String() string {", + (string) (len=33) "\tif str, ok := _CasesMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=35) "\treturn fmt.Sprintf(\"Cases(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=35) "var _CasesValue = map[string]Cases{", + (string) (len=47) "\t_CasesName[0:10]: TestLower,", + (string) (len=47) "\tstrings.ToLower(_CasesName[0:10]): TestLower,", + (string) (len=49) "\t_CasesName[10:22]: TestCapital,", + (string) (len=49) "\tstrings.ToLower(_CasesName[10:22]): TestCapital,", + (string) (len=59) "\t_CasesName[22:43]: AnotherLowerCaseStart,", + (string) (len=59) "\tstrings.ToLower(_CasesName[22:43]): AnotherLowerCaseStart,", + (string) (len=1) "}", + (string) "", + (string) (len=54) "// ParseCases attempts to convert a string to a Cases.", + (string) (len=45) "func ParseCases(name string) (Cases, error) {", + (string) (len=36) "\tif x, ok := _CasesValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=61) "\treturn Cases(0), fmt.Errorf(\"%s is not a valid Cases\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=46) "func (x Cases) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=50) "func (x *Cases) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=29) "\ttmp, err := ParseCases(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=39) "func (x *Cases) Set(val string) error {", + (string) (len=26) "\tv, err := ParseCases(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=35) "func (x *Cases) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=31) "func (x *Cases) Type() string {", + (string) (len=15) "\treturn \"Cases\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=35) "\t// Black is a Color of type Black.", + (string) (len=19) "\tBlack Color = iota", + (string) (len=35) "\t// White is a Color of type White.", + (string) (len=6) "\tWhite", + (string) (len=31) "\t// Red is a Color of type Red.", + (string) (len=4) "\tRed", + (string) (len=35) "\t// Green is a Color of type Green.", + (string) (len=6) "\tGreen", + (string) (len=33) "\t// Blue is a Color of type Blue.", + (string) (len=23) "\tBlue Color = iota + 29", + (string) (len=33) "\t// Grey is a Color of type Grey.", + (string) (len=5) "\tGrey", + (string) (len=37) "\t// Yellow is a Color of type Yellow.", + (string) (len=7) "\tYellow", + (string) (len=1) ")", + (string) "", + (string) (len=53) "const _ColorName = \"BlackWhiteRedGreenBluegreyyellow\"", + (string) "", + (string) (len=33) "var _ColorMap = map[Color]string{", + (string) (len=25) "\tBlack: _ColorName[0:5],", + (string) (len=26) "\tWhite: _ColorName[5:10],", + (string) (len=27) "\tRed: _ColorName[10:13],", + (string) (len=27) "\tGreen: _ColorName[13:18],", + (string) (len=27) "\tBlue: _ColorName[18:22],", + (string) (len=27) "\tGrey: _ColorName[22:26],", + (string) (len=27) "\tYellow: _ColorName[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=32) "func (x Color) String() string {", + (string) (len=33) "\tif str, ok := _ColorMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=35) "\treturn fmt.Sprintf(\"Color(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=35) "var _ColorValue = map[string]Color{", + (string) (len=43) "\t_ColorName[0:5]: Black,", + (string) (len=43) "\tstrings.ToLower(_ColorName[0:5]): Black,", + (string) (len=43) "\t_ColorName[5:10]: White,", + (string) (len=43) "\tstrings.ToLower(_ColorName[5:10]): White,", + (string) (len=41) "\t_ColorName[10:13]: Red,", + (string) (len=41) "\tstrings.ToLower(_ColorName[10:13]): Red,", + (string) (len=43) "\t_ColorName[13:18]: Green,", + (string) (len=43) "\tstrings.ToLower(_ColorName[13:18]): Green,", + (string) (len=42) "\t_ColorName[18:22]: Blue,", + (string) (len=42) "\tstrings.ToLower(_ColorName[18:22]): Blue,", + (string) (len=42) "\t_ColorName[22:26]: Grey,", + (string) (len=42) "\tstrings.ToLower(_ColorName[22:26]): Grey,", + (string) (len=44) "\t_ColorName[26:32]: Yellow,", + (string) (len=44) "\tstrings.ToLower(_ColorName[26:32]): Yellow,", + (string) (len=1) "}", + (string) "", + (string) (len=54) "// ParseColor attempts to convert a string to a Color.", + (string) (len=45) "func ParseColor(name string) (Color, error) {", + (string) (len=36) "\tif x, ok := _ColorValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=61) "\treturn Color(0), fmt.Errorf(\"%s is not a valid Color\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=46) "func (x Color) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=50) "func (x *Color) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=29) "\ttmp, err := ParseColor(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=39) "func (x *Color) Set(val string) error {", + (string) (len=26) "\tv, err := ParseColor(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=35) "func (x *Color) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=31) "func (x *Color) Type() string {", + (string) (len=15) "\treturn \"Color\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=46) "\t// Black is a ColorWithComment of type Black.", + (string) (len=30) "\tBlack ColorWithComment = iota", + (string) (len=46) "\t// White is a ColorWithComment of type White.", + (string) (len=6) "\tWhite", + (string) (len=42) "\t// Red is a ColorWithComment of type Red.", + (string) (len=4) "\tRed", + (string) (len=46) "\t// Green is a ColorWithComment of type Green.", + (string) (len=6) "\tGreen", + (string) (len=44) "\t// Blue is a ColorWithComment of type Blue.", + (string) (len=23) "\t// Blue starts with 33", + (string) (len=34) "\tBlue ColorWithComment = iota + 29", + (string) (len=44) "\t// Grey is a ColorWithComment of type Grey.", + (string) (len=5) "\tGrey", + (string) (len=48) "\t// Yellow is a ColorWithComment of type Yellow.", + (string) (len=7) "\tYellow", + (string) (len=1) ")", + (string) "", + (string) (len=64) "const _ColorWithCommentName = \"BlackWhiteRedGreenBluegreyyellow\"", + (string) "", + (string) (len=55) "var _ColorWithCommentMap = map[ColorWithComment]string{", + (string) (len=36) "\tBlack: _ColorWithCommentName[0:5],", + (string) (len=37) "\tWhite: _ColorWithCommentName[5:10],", + (string) (len=38) "\tRed: _ColorWithCommentName[10:13],", + (string) (len=38) "\tGreen: _ColorWithCommentName[13:18],", + (string) (len=38) "\tBlue: _ColorWithCommentName[18:22],", + (string) (len=38) "\tGrey: _ColorWithCommentName[22:26],", + (string) (len=38) "\tYellow: _ColorWithCommentName[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=43) "func (x ColorWithComment) String() string {", + (string) (len=44) "\tif str, ok := _ColorWithCommentMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=46) "\treturn fmt.Sprintf(\"ColorWithComment(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=57) "var _ColorWithCommentValue = map[string]ColorWithComment{", + (string) (len=54) "\t_ColorWithCommentName[0:5]: Black,", + (string) (len=54) "\tstrings.ToLower(_ColorWithCommentName[0:5]): Black,", + (string) (len=54) "\t_ColorWithCommentName[5:10]: White,", + (string) (len=54) "\tstrings.ToLower(_ColorWithCommentName[5:10]): White,", + (string) (len=52) "\t_ColorWithCommentName[10:13]: Red,", + (string) (len=52) "\tstrings.ToLower(_ColorWithCommentName[10:13]): Red,", + (string) (len=54) "\t_ColorWithCommentName[13:18]: Green,", + (string) (len=54) "\tstrings.ToLower(_ColorWithCommentName[13:18]): Green,", + (string) (len=53) "\t_ColorWithCommentName[18:22]: Blue,", + (string) (len=53) "\tstrings.ToLower(_ColorWithCommentName[18:22]): Blue,", + (string) (len=53) "\t_ColorWithCommentName[22:26]: Grey,", + (string) (len=53) "\tstrings.ToLower(_ColorWithCommentName[22:26]): Grey,", + (string) (len=55) "\t_ColorWithCommentName[26:32]: Yellow,", + (string) (len=55) "\tstrings.ToLower(_ColorWithCommentName[26:32]): Yellow,", + (string) (len=1) "}", + (string) "", + (string) (len=76) "// ParseColorWithComment attempts to convert a string to a ColorWithComment.", + (string) (len=67) "func ParseColorWithComment(name string) (ColorWithComment, error) {", + (string) (len=47) "\tif x, ok := _ColorWithCommentValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=83) "\treturn ColorWithComment(0), fmt.Errorf(\"%s is not a valid ColorWithComment\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=57) "func (x ColorWithComment) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=61) "func (x *ColorWithComment) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=40) "\ttmp, err := ParseColorWithComment(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=50) "func (x *ColorWithComment) Set(val string) error {", + (string) (len=37) "\tv, err := ParseColorWithComment(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=46) "func (x *ColorWithComment) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=42) "func (x *ColorWithComment) Type() string {", + (string) (len=26) "\treturn \"ColorWithComment\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=47) "\t// Black is a ColorWithComment2 of type Black.", + (string) (len=31) "\tBlack ColorWithComment2 = iota", + (string) (len=47) "\t// White is a ColorWithComment2 of type White.", + (string) (len=6) "\tWhite", + (string) (len=43) "\t// Red is a ColorWithComment2 of type Red.", + (string) (len=4) "\tRed", + (string) (len=47) "\t// Green is a ColorWithComment2 of type Green.", + (string) (len=6) "\tGreen", + (string) (len=45) "\t// Blue is a ColorWithComment2 of type Blue.", + (string) (len=23) "\t// Blue starts with 33", + (string) (len=35) "\tBlue ColorWithComment2 = iota + 29", + (string) (len=45) "\t// Grey is a ColorWithComment2 of type Grey.", + (string) (len=5) "\tGrey", + (string) (len=49) "\t// Yellow is a ColorWithComment2 of type Yellow.", + (string) (len=7) "\tYellow", + (string) (len=1) ")", + (string) "", + (string) (len=65) "const _ColorWithComment2Name = \"BlackWhiteRedGreenBluegreyyellow\"", + (string) "", + (string) (len=57) "var _ColorWithComment2Map = map[ColorWithComment2]string{", + (string) (len=37) "\tBlack: _ColorWithComment2Name[0:5],", + (string) (len=38) "\tWhite: _ColorWithComment2Name[5:10],", + (string) (len=39) "\tRed: _ColorWithComment2Name[10:13],", + (string) (len=39) "\tGreen: _ColorWithComment2Name[13:18],", + (string) (len=39) "\tBlue: _ColorWithComment2Name[18:22],", + (string) (len=39) "\tGrey: _ColorWithComment2Name[22:26],", + (string) (len=39) "\tYellow: _ColorWithComment2Name[26:32],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=44) "func (x ColorWithComment2) String() string {", + (string) (len=45) "\tif str, ok := _ColorWithComment2Map[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=47) "\treturn fmt.Sprintf(\"ColorWithComment2(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=59) "var _ColorWithComment2Value = map[string]ColorWithComment2{", + (string) (len=55) "\t_ColorWithComment2Name[0:5]: Black,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment2Name[0:5]): Black,", + (string) (len=55) "\t_ColorWithComment2Name[5:10]: White,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment2Name[5:10]): White,", + (string) (len=53) "\t_ColorWithComment2Name[10:13]: Red,", + (string) (len=53) "\tstrings.ToLower(_ColorWithComment2Name[10:13]): Red,", + (string) (len=55) "\t_ColorWithComment2Name[13:18]: Green,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment2Name[13:18]): Green,", + (string) (len=54) "\t_ColorWithComment2Name[18:22]: Blue,", + (string) (len=54) "\tstrings.ToLower(_ColorWithComment2Name[18:22]): Blue,", + (string) (len=54) "\t_ColorWithComment2Name[22:26]: Grey,", + (string) (len=54) "\tstrings.ToLower(_ColorWithComment2Name[22:26]): Grey,", + (string) (len=56) "\t_ColorWithComment2Name[26:32]: Yellow,", + (string) (len=56) "\tstrings.ToLower(_ColorWithComment2Name[26:32]): Yellow,", + (string) (len=1) "}", + (string) "", + (string) (len=78) "// ParseColorWithComment2 attempts to convert a string to a ColorWithComment2.", + (string) (len=69) "func ParseColorWithComment2(name string) (ColorWithComment2, error) {", + (string) (len=48) "\tif x, ok := _ColorWithComment2Value[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=85) "\treturn ColorWithComment2(0), fmt.Errorf(\"%s is not a valid ColorWithComment2\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=58) "func (x ColorWithComment2) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=62) "func (x *ColorWithComment2) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=41) "\ttmp, err := ParseColorWithComment2(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=51) "func (x *ColorWithComment2) Set(val string) error {", + (string) (len=38) "\tv, err := ParseColorWithComment2(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=47) "func (x *ColorWithComment2) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=43) "func (x *ColorWithComment2) Type() string {", + (string) (len=27) "\treturn \"ColorWithComment2\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=47) "\t// Black is a ColorWithComment3 of type Black.", + (string) (len=31) "\tBlack ColorWithComment3 = iota", + (string) (len=47) "\t// White is a ColorWithComment3 of type White.", + (string) (len=6) "\tWhite", + (string) (len=43) "\t// Red is a ColorWithComment3 of type Red.", + (string) (len=4) "\tRed", + (string) (len=47) "\t// Green is a ColorWithComment3 of type Green.", + (string) (len=24) "\t// Green starts with 33", + (string) (len=36) "\tGreen ColorWithComment3 = iota + 30", + (string) (len=45) "\t// Blue is a ColorWithComment3 of type Blue.", + (string) (len=5) "\tBlue", + (string) (len=45) "\t// Grey is a ColorWithComment3 of type Grey.", + (string) (len=5) "\tGrey", + (string) (len=49) "\t// Yellow is a ColorWithComment3 of type Yellow.", + (string) (len=7) "\tYellow", + (string) (len=56) "\t// BlueGreen is a ColorWithComment3 of type Blue-Green.", + (string) (len=22) "\t// blue-green comment", + (string) (len=10) "\tBlueGreen", + (string) (len=56) "\t// RedOrange is a ColorWithComment3 of type Red-Orange.", + (string) (len=10) "\tRedOrange", + (string) (len=65) "\t// RedOrangeBlue is a ColorWithComment3 of type Red-Orange-Blue.", + (string) (len=14) "\tRedOrangeBlue", + (string) (len=1) ")", + (string) "", + (string) (len=100) "const _ColorWithComment3Name = \"BlackWhiteRedGreenBluegreyyellowblue-greenred-orangered-orange-blue\"", + (string) "", + (string) (len=57) "var _ColorWithComment3Map = map[ColorWithComment3]string{", + (string) (len=44) "\tBlack: _ColorWithComment3Name[0:5],", + (string) (len=45) "\tWhite: _ColorWithComment3Name[5:10],", + (string) (len=46) "\tRed: _ColorWithComment3Name[10:13],", + (string) (len=46) "\tGreen: _ColorWithComment3Name[13:18],", + (string) (len=46) "\tBlue: _ColorWithComment3Name[18:22],", + (string) (len=46) "\tGrey: _ColorWithComment3Name[22:26],", + (string) (len=46) "\tYellow: _ColorWithComment3Name[26:32],", + (string) (len=46) "\tBlueGreen: _ColorWithComment3Name[32:42],", + (string) (len=46) "\tRedOrange: _ColorWithComment3Name[42:52],", + (string) (len=46) "\tRedOrangeBlue: _ColorWithComment3Name[52:67],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=44) "func (x ColorWithComment3) String() string {", + (string) (len=45) "\tif str, ok := _ColorWithComment3Map[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=47) "\treturn fmt.Sprintf(\"ColorWithComment3(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=59) "var _ColorWithComment3Value = map[string]ColorWithComment3{", + (string) (len=55) "\t_ColorWithComment3Name[0:5]: Black,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment3Name[0:5]): Black,", + (string) (len=55) "\t_ColorWithComment3Name[5:10]: White,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment3Name[5:10]): White,", + (string) (len=53) "\t_ColorWithComment3Name[10:13]: Red,", + (string) (len=53) "\tstrings.ToLower(_ColorWithComment3Name[10:13]): Red,", + (string) (len=55) "\t_ColorWithComment3Name[13:18]: Green,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment3Name[13:18]): Green,", + (string) (len=54) "\t_ColorWithComment3Name[18:22]: Blue,", + (string) (len=54) "\tstrings.ToLower(_ColorWithComment3Name[18:22]): Blue,", + (string) (len=54) "\t_ColorWithComment3Name[22:26]: Grey,", + (string) (len=54) "\tstrings.ToLower(_ColorWithComment3Name[22:26]): Grey,", + (string) (len=56) "\t_ColorWithComment3Name[26:32]: Yellow,", + (string) (len=56) "\tstrings.ToLower(_ColorWithComment3Name[26:32]): Yellow,", + (string) (len=59) "\t_ColorWithComment3Name[32:42]: BlueGreen,", + (string) (len=59) "\tstrings.ToLower(_ColorWithComment3Name[32:42]): BlueGreen,", + (string) (len=59) "\t_ColorWithComment3Name[42:52]: RedOrange,", + (string) (len=59) "\tstrings.ToLower(_ColorWithComment3Name[42:52]): RedOrange,", + (string) (len=63) "\t_ColorWithComment3Name[52:67]: RedOrangeBlue,", + (string) (len=63) "\tstrings.ToLower(_ColorWithComment3Name[52:67]): RedOrangeBlue,", + (string) (len=1) "}", + (string) "", + (string) (len=78) "// ParseColorWithComment3 attempts to convert a string to a ColorWithComment3.", + (string) (len=69) "func ParseColorWithComment3(name string) (ColorWithComment3, error) {", + (string) (len=48) "\tif x, ok := _ColorWithComment3Value[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=85) "\treturn ColorWithComment3(0), fmt.Errorf(\"%s is not a valid ColorWithComment3\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=58) "func (x ColorWithComment3) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=62) "func (x *ColorWithComment3) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=41) "\ttmp, err := ParseColorWithComment3(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=51) "func (x *ColorWithComment3) Set(val string) error {", + (string) (len=38) "\tv, err := ParseColorWithComment3(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=47) "func (x *ColorWithComment3) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=43) "func (x *ColorWithComment3) Type() string {", + (string) (len=27) "\treturn \"ColorWithComment3\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=18) "\t// Skipped value.", + (string) (len=15) "\t// Placeholder", + (string) (len=27) "\t_ ColorWithComment4 = iota", + (string) (len=47) "\t// Black is a ColorWithComment4 of type Black.", + (string) (len=6) "\tBlack", + (string) (len=47) "\t// White is a ColorWithComment4 of type White.", + (string) (len=6) "\tWhite", + (string) (len=43) "\t// Red is a ColorWithComment4 of type Red.", + (string) (len=4) "\tRed", + (string) (len=47) "\t// Green is a ColorWithComment4 of type Green.", + (string) (len=24) "\t// Green starts with 33", + (string) (len=36) "\tGreen ColorWithComment4 = iota + 29", + (string) (len=45) "\t// Blue is a ColorWithComment4 of type Blue.", + (string) (len=5) "\tBlue", + (string) (len=45) "\t// Grey is a ColorWithComment4 of type Grey.", + (string) (len=5) "\tGrey", + (string) (len=49) "\t// Yellow is a ColorWithComment4 of type Yellow.", + (string) (len=110) "\t// Where did all the (somewhat) bad fish go? (something else that goes in parentheses at the end of the line)", + (string) (len=7) "\tYellow", + (string) (len=56) "\t// BlueGreen is a ColorWithComment4 of type Blue-Green.", + (string) (len=22) "\t// blue-green comment", + (string) (len=10) "\tBlueGreen", + (string) (len=56) "\t// RedOrange is a ColorWithComment4 of type Red-Orange.", + (string) (len=20) "\t// has a , in it!?!", + (string) (len=10) "\tRedOrange", + (string) (len=1) ")", + (string) "", + (string) (len=85) "const _ColorWithComment4Name = \"BlackWhiteRedGreenBluegreyyellowblue-greenred-orange\"", + (string) "", + (string) (len=57) "var _ColorWithComment4Map = map[ColorWithComment4]string{", + (string) (len=40) "\tBlack: _ColorWithComment4Name[0:5],", + (string) (len=41) "\tWhite: _ColorWithComment4Name[5:10],", + (string) (len=42) "\tRed: _ColorWithComment4Name[10:13],", + (string) (len=42) "\tGreen: _ColorWithComment4Name[13:18],", + (string) (len=42) "\tBlue: _ColorWithComment4Name[18:22],", + (string) (len=42) "\tGrey: _ColorWithComment4Name[22:26],", + (string) (len=42) "\tYellow: _ColorWithComment4Name[26:32],", + (string) (len=42) "\tBlueGreen: _ColorWithComment4Name[32:42],", + (string) (len=42) "\tRedOrange: _ColorWithComment4Name[42:52],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=44) "func (x ColorWithComment4) String() string {", + (string) (len=45) "\tif str, ok := _ColorWithComment4Map[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=47) "\treturn fmt.Sprintf(\"ColorWithComment4(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=59) "var _ColorWithComment4Value = map[string]ColorWithComment4{", + (string) (len=55) "\t_ColorWithComment4Name[0:5]: Black,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment4Name[0:5]): Black,", + (string) (len=55) "\t_ColorWithComment4Name[5:10]: White,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment4Name[5:10]): White,", + (string) (len=53) "\t_ColorWithComment4Name[10:13]: Red,", + (string) (len=53) "\tstrings.ToLower(_ColorWithComment4Name[10:13]): Red,", + (string) (len=55) "\t_ColorWithComment4Name[13:18]: Green,", + (string) (len=55) "\tstrings.ToLower(_ColorWithComment4Name[13:18]): Green,", + (string) (len=54) "\t_ColorWithComment4Name[18:22]: Blue,", + (string) (len=54) "\tstrings.ToLower(_ColorWithComment4Name[18:22]): Blue,", + (string) (len=54) "\t_ColorWithComment4Name[22:26]: Grey,", + (string) (len=54) "\tstrings.ToLower(_ColorWithComment4Name[22:26]): Grey,", + (string) (len=56) "\t_ColorWithComment4Name[26:32]: Yellow,", + (string) (len=56) "\tstrings.ToLower(_ColorWithComment4Name[26:32]): Yellow,", + (string) (len=59) "\t_ColorWithComment4Name[32:42]: BlueGreen,", + (string) (len=59) "\tstrings.ToLower(_ColorWithComment4Name[32:42]): BlueGreen,", + (string) (len=59) "\t_ColorWithComment4Name[42:52]: RedOrange,", + (string) (len=59) "\tstrings.ToLower(_ColorWithComment4Name[42:52]): RedOrange,", + (string) (len=1) "}", + (string) "", + (string) (len=78) "// ParseColorWithComment4 attempts to convert a string to a ColorWithComment4.", + (string) (len=69) "func ParseColorWithComment4(name string) (ColorWithComment4, error) {", + (string) (len=48) "\tif x, ok := _ColorWithComment4Value[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=85) "\treturn ColorWithComment4(0), fmt.Errorf(\"%s is not a valid ColorWithComment4\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=58) "func (x ColorWithComment4) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=62) "func (x *ColorWithComment4) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=41) "\ttmp, err := ParseColorWithComment4(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=51) "func (x *ColorWithComment4) Set(val string) error {", + (string) (len=38) "\tv, err := ParseColorWithComment4(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=47) "func (x *ColorWithComment4) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=43) "func (x *ColorWithComment4) Type() string {", + (string) (len=27) "\treturn \"ColorWithComment4\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=43) "\t// Unknown is a Enum64bit of type Unknown.", + (string) (len=25) "\tUnknown Enum64bit = iota", + (string) (len=39) "\t// E2P15 is a Enum64bit of type E2P15.", + (string) (len=31) "\tE2P15 Enum64bit = iota + 32767", + (string) (len=39) "\t// E2P16 is a Enum64bit of type E2P16.", + (string) (len=31) "\tE2P16 Enum64bit = iota + 65534", + (string) (len=39) "\t// E2P17 is a Enum64bit of type E2P17.", + (string) (len=32) "\tE2P17 Enum64bit = iota + 131069", + (string) (len=39) "\t// E2P18 is a Enum64bit of type E2P18.", + (string) (len=32) "\tE2P18 Enum64bit = iota + 262140", + (string) (len=39) "\t// E2P19 is a Enum64bit of type E2P19.", + (string) (len=32) "\tE2P19 Enum64bit = iota + 524283", + (string) (len=39) "\t// E2P20 is a Enum64bit of type E2P20.", + (string) (len=33) "\tE2P20 Enum64bit = iota + 1048570", + (string) (len=39) "\t// E2P21 is a Enum64bit of type E2P21.", + (string) (len=33) "\tE2P21 Enum64bit = iota + 2097145", + (string) (len=39) "\t// E2P22 is a Enum64bit of type E2P22.", + (string) (len=34) "\tE2P22 Enum64bit = iota + 33554424", + (string) (len=39) "\t// E2P23 is a Enum64bit of type E2P23.", + (string) (len=34) "\tE2P23 Enum64bit = iota + 67108855", + (string) (len=39) "\t// E2P28 is a Enum64bit of type E2P28.", + (string) (len=35) "\tE2P28 Enum64bit = iota + 536870902", + (string) (len=39) "\t// E2P30 is a Enum64bit of type E2P30.", + (string) (len=36) "\tE2P30 Enum64bit = iota + 1073741813", + (string) (len=39) "\t// E2P31 is a Enum64bit of type E2P31.", + (string) (len=36) "\tE2P31 Enum64bit = iota + 2147483636", + (string) (len=39) "\t// E2P32 is a Enum64bit of type E2P32.", + (string) (len=36) "\tE2P32 Enum64bit = iota + 4294967283", + (string) (len=39) "\t// E2P33 is a Enum64bit of type E2P33.", + (string) (len=36) "\tE2P33 Enum64bit = iota + 8454967282", + (string) (len=1) ")", + (string) "", + (string) (len=102) "const _Enum64bitName = \"UnknownE2P15E2P16E2P17E2P18E2P19E2P20E2P21E2P22E2P23E2P28E2P30E2P31E2P32E2P33\"", + (string) "", + (string) (len=41) "var _Enum64bitMap = map[Enum64bit]string{", + (string) (len=30) "\tUnknown: _Enum64bitName[0:7],", + (string) (len=31) "\tE2P15: _Enum64bitName[7:12],", + (string) (len=32) "\tE2P16: _Enum64bitName[12:17],", + (string) (len=32) "\tE2P17: _Enum64bitName[17:22],", + (string) (len=32) "\tE2P18: _Enum64bitName[22:27],", + (string) (len=32) "\tE2P19: _Enum64bitName[27:32],", + (string) (len=32) "\tE2P20: _Enum64bitName[32:37],", + (string) (len=32) "\tE2P21: _Enum64bitName[37:42],", + (string) (len=32) "\tE2P22: _Enum64bitName[42:47],", + (string) (len=32) "\tE2P23: _Enum64bitName[47:52],", + (string) (len=32) "\tE2P28: _Enum64bitName[52:57],", + (string) (len=32) "\tE2P30: _Enum64bitName[57:62],", + (string) (len=32) "\tE2P31: _Enum64bitName[62:67],", + (string) (len=32) "\tE2P32: _Enum64bitName[67:72],", + (string) (len=32) "\tE2P33: _Enum64bitName[72:77],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=36) "func (x Enum64bit) String() string {", + (string) (len=37) "\tif str, ok := _Enum64bitMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=39) "\treturn fmt.Sprintf(\"Enum64bit(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=43) "var _Enum64bitValue = map[string]Enum64bit{", + (string) (len=49) "\t_Enum64bitName[0:7]: Unknown,", + (string) (len=49) "\tstrings.ToLower(_Enum64bitName[0:7]): Unknown,", + (string) (len=47) "\t_Enum64bitName[7:12]: E2P15,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[7:12]): E2P15,", + (string) (len=47) "\t_Enum64bitName[12:17]: E2P16,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[12:17]): E2P16,", + (string) (len=47) "\t_Enum64bitName[17:22]: E2P17,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[17:22]): E2P17,", + (string) (len=47) "\t_Enum64bitName[22:27]: E2P18,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[22:27]): E2P18,", + (string) (len=47) "\t_Enum64bitName[27:32]: E2P19,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[27:32]): E2P19,", + (string) (len=47) "\t_Enum64bitName[32:37]: E2P20,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[32:37]): E2P20,", + (string) (len=47) "\t_Enum64bitName[37:42]: E2P21,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[37:42]): E2P21,", + (string) (len=47) "\t_Enum64bitName[42:47]: E2P22,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[42:47]): E2P22,", + (string) (len=47) "\t_Enum64bitName[47:52]: E2P23,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[47:52]): E2P23,", + (string) (len=47) "\t_Enum64bitName[52:57]: E2P28,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[52:57]): E2P28,", + (string) (len=47) "\t_Enum64bitName[57:62]: E2P30,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[57:62]): E2P30,", + (string) (len=47) "\t_Enum64bitName[62:67]: E2P31,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[62:67]): E2P31,", + (string) (len=47) "\t_Enum64bitName[67:72]: E2P32,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[67:72]): E2P32,", + (string) (len=47) "\t_Enum64bitName[72:77]: E2P33,", + (string) (len=47) "\tstrings.ToLower(_Enum64bitName[72:77]): E2P33,", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// ParseEnum64bit attempts to convert a string to a Enum64bit.", + (string) (len=53) "func ParseEnum64bit(name string) (Enum64bit, error) {", + (string) (len=40) "\tif x, ok := _Enum64bitValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=69) "\treturn Enum64bit(0), fmt.Errorf(\"%s is not a valid Enum64bit\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=50) "func (x Enum64bit) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=54) "func (x *Enum64bit) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=33) "\ttmp, err := ParseEnum64bit(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=43) "func (x *Enum64bit) Set(val string) error {", + (string) (len=30) "\tv, err := ParseEnum64bit(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=39) "func (x *Enum64bit) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=35) "func (x *Enum64bit) Type() string {", + (string) (len=19) "\treturn \"Enum64bit\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=37) "\t// Toyota is a Model of type Toyota.", + (string) (len=20) "\tToyota Model = iota", + (string) (len=18) "\t// Skipped value.", + (string) (len=2) "\t_", + (string) (len=35) "\t// Chevy is a Model of type Chevy.", + (string) (len=6) "\tChevy", + (string) (len=18) "\t// Skipped value.", + (string) (len=2) "\t_", + (string) (len=33) "\t// Ford is a Model of type Ford.", + (string) (len=5) "\tFord", + (string) (len=1) ")", + (string) "", + (string) (len=36) "const _ModelName = \"ToyotaChevyFord\"", + (string) "", + (string) (len=33) "var _ModelMap = map[Model]string{", + (string) (len=25) "\tToyota: _ModelName[0:6],", + (string) (len=26) "\tChevy: _ModelName[6:11],", + (string) (len=27) "\tFord: _ModelName[11:15],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=32) "func (x Model) String() string {", + (string) (len=33) "\tif str, ok := _ModelMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=35) "\treturn fmt.Sprintf(\"Model(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=35) "var _ModelValue = map[string]Model{", + (string) (len=44) "\t_ModelName[0:6]: Toyota,", + (string) (len=44) "\tstrings.ToLower(_ModelName[0:6]): Toyota,", + (string) (len=43) "\t_ModelName[6:11]: Chevy,", + (string) (len=43) "\tstrings.ToLower(_ModelName[6:11]): Chevy,", + (string) (len=42) "\t_ModelName[11:15]: Ford,", + (string) (len=42) "\tstrings.ToLower(_ModelName[11:15]): Ford,", + (string) (len=1) "}", + (string) "", + (string) (len=54) "// ParseModel attempts to convert a string to a Model.", + (string) (len=45) "func ParseModel(name string) (Model, error) {", + (string) (len=36) "\tif x, ok := _ModelValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=61) "\treturn Model(0), fmt.Errorf(\"%s is not a valid Model\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=46) "func (x Model) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=50) "func (x *Model) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=29) "\ttmp, err := ParseModel(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=39) "func (x *Model) Set(val string) error {", + (string) (len=26) "\tv, err := ParseModel(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=35) "func (x *Model) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=31) "func (x *Model) Type() string {", + (string) (len=15) "\treturn \"Model\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=51) "\t// TestHyphen is a Sanitizing of type Test-Hyphen.", + (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=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=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-.", + (string) (len=13) "\tEndingHyphen", + (string) (len=1) ")", + (string) "", + (string) (len=112) "const _SanitizingName = \"test-Hyphen-hyphenStart_underscoreFirst0numberFirst123456789a123123-asdfending-hyphen-\"", + (string) "", + (string) (len=43) "var _SanitizingMap = map[Sanitizing]string{", + (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) "\tX123123Asdf: _SanitizingName[61:72],", + (string) (len=42) "\tEndingHyphen: _SanitizingName[72:86],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=37) "func (x Sanitizing) String() string {", + (string) (len=38) "\tif str, ok := _SanitizingMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=40) "\treturn fmt.Sprintf(\"Sanitizing(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=45) "var _SanitizingValue = map[string]Sanitizing{", + (string) (len=53) "\t_SanitizingName[0:11]: TestHyphen,", + (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=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=54) "\t_SanitizingName[61:72]: X123123Asdf,", + (string) (len=54) "\tstrings.ToLower(_SanitizingName[61:72]): X123123Asdf,", + (string) (len=55) "\t_SanitizingName[72:86]: EndingHyphen,", + (string) (len=55) "\tstrings.ToLower(_SanitizingName[72:86]): EndingHyphen,", + (string) (len=1) "}", + (string) "", + (string) (len=64) "// ParseSanitizing attempts to convert a string to a Sanitizing.", + (string) (len=55) "func ParseSanitizing(name string) (Sanitizing, error) {", + (string) (len=41) "\tif x, ok := _SanitizingValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=71) "\treturn Sanitizing(0), fmt.Errorf(\"%s is not a valid Sanitizing\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=51) "func (x Sanitizing) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=55) "func (x *Sanitizing) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=34) "\ttmp, err := ParseSanitizing(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=44) "func (x *Sanitizing) Set(val string) error {", + (string) (len=31) "\tv, err := ParseSanitizing(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=40) "func (x *Sanitizing) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=36) "func (x *Sanitizing) Type() string {", + (string) (len=20) "\treturn \"Sanitizing\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=32) "\t// Coke is a Soda of type Coke.", + (string) (len=17) "\tCoke Soda = iota", + (string) (len=34) "\t// Pepsi is a Soda of type Pepsi.", + (string) (len=6) "\tPepsi", + (string) (len=36) "\t// MtnDew is a Soda of type MtnDew.", + (string) (len=7) "\tMtnDew", + (string) (len=1) ")", + (string) "", + (string) (len=35) "const _SodaName = \"CokePepsiMtnDew\"", + (string) "", + (string) (len=31) "var _SodaMap = map[Soda]string{", + (string) (len=24) "\tCoke: _SodaName[0:4],", + (string) (len=24) "\tPepsi: _SodaName[4:9],", + (string) (len=25) "\tMtnDew: _SodaName[9:15],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=31) "func (x Soda) String() string {", + (string) (len=32) "\tif str, ok := _SodaMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=34) "\treturn fmt.Sprintf(\"Soda(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=33) "var _SodaValue = map[string]Soda{", + (string) (len=40) "\t_SodaName[0:4]: Coke,", + (string) (len=40) "\tstrings.ToLower(_SodaName[0:4]): Coke,", + (string) (len=41) "\t_SodaName[4:9]: Pepsi,", + (string) (len=41) "\tstrings.ToLower(_SodaName[4:9]): Pepsi,", + (string) (len=42) "\t_SodaName[9:15]: MtnDew,", + (string) (len=42) "\tstrings.ToLower(_SodaName[9:15]): MtnDew,", + (string) (len=1) "}", + (string) "", + (string) (len=52) "// ParseSoda attempts to convert a string to a Soda.", + (string) (len=43) "func ParseSoda(name string) (Soda, error) {", + (string) (len=35) "\tif x, ok := _SodaValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=59) "\treturn Soda(0), fmt.Errorf(\"%s is not a valid Soda\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=45) "func (x Soda) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=49) "func (x *Soda) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=28) "\ttmp, err := ParseSoda(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=38) "func (x *Soda) Set(val string) error {", + (string) (len=25) "\tv, err := ParseSoda(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=34) "func (x *Soda) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=30) "func (x *Soda) Type() string {", + (string) (len=14) "\treturn \"Soda\"", + (string) (len=1) "}", + (string) "", + (string) (len=7) "const (", + (string) (len=56) "\t// StartWithNum is a StartNotZero of type StartWithNum.", + (string) (len=38) "\tStartWithNum StartNotZero = iota + 23", + (string) (len=46) "\t// NextNum is a StartNotZero of type NextNum.", + (string) (len=8) "\tNextNum", + (string) (len=1) ")", + (string) "", + (string) (len=47) "const _StartNotZeroName = \"startWithNumnextNum\"", + (string) "", + (string) (len=47) "var _StartNotZeroMap = map[StartNotZero]string{", + (string) (len=39) "\tStartWithNum: _StartNotZeroName[0:12],", + (string) (len=40) "\tNextNum: _StartNotZeroName[12:19],", + (string) (len=1) "}", + (string) "", + (string) (len=44) "// String implements the Stringer interface.", + (string) (len=39) "func (x StartNotZero) String() string {", + (string) (len=40) "\tif str, ok := _StartNotZeroMap[x]; ok {", + (string) (len=12) "\t\treturn str", + (string) (len=2) "\t}", + (string) (len=42) "\treturn fmt.Sprintf(\"StartNotZero(%d)\", x)", + (string) (len=1) "}", + (string) "", + (string) (len=49) "var _StartNotZeroValue = map[string]StartNotZero{", + (string) (len=57) "\t_StartNotZeroName[0:12]: StartWithNum,", + (string) (len=57) "\tstrings.ToLower(_StartNotZeroName[0:12]): StartWithNum,", + (string) (len=52) "\t_StartNotZeroName[12:19]: NextNum,", + (string) (len=52) "\tstrings.ToLower(_StartNotZeroName[12:19]): NextNum,", + (string) (len=1) "}", + (string) "", + (string) (len=68) "// ParseStartNotZero attempts to convert a string to a StartNotZero.", + (string) (len=59) "func ParseStartNotZero(name string) (StartNotZero, error) {", + (string) (len=43) "\tif x, ok := _StartNotZeroValue[name]; ok {", + (string) (len=15) "\t\treturn x, nil", + (string) (len=2) "\t}", + (string) (len=75) "\treturn StartNotZero(0), fmt.Errorf(\"%s is not a valid StartNotZero\", name)", + (string) (len=1) "}", + (string) "", + (string) (len=53) "// MarshalText implements the text marshaller method.", + (string) (len=53) "func (x StartNotZero) MarshalText() ([]byte, error) {", + (string) (len=31) "\treturn []byte(x.String()), nil", + (string) (len=1) "}", + (string) "", + (string) (len=57) "// UnmarshalText implements the text unmarshaller method.", + (string) (len=57) "func (x *StartNotZero) UnmarshalText(text []byte) error {", + (string) (len=21) "\tname := string(text)", + (string) (len=36) "\ttmp, err := ParseStartNotZero(name)", + (string) (len=16) "\tif err != nil {", + (string) (len=12) "\t\treturn err", + (string) (len=2) "\t}", + (string) (len=9) "\t*x = tmp", + (string) (len=11) "\treturn nil", + (string) (len=1) "}", + (string) "", + (string) (len=55) "// Set implements the Golang flag.Value interface func.", + (string) (len=46) "func (x *StartNotZero) Set(val string) error {", + (string) (len=33) "\tv, err := ParseStartNotZero(val)", + (string) (len=7) "\t*x = v", + (string) (len=11) "\treturn err", + (string) (len=1) "}", + (string) "", + (string) (len=56) "// Get implements the Golang flag.Getter interface func.", + (string) (len=42) "func (x *StartNotZero) Get() interface{} {", + (string) (len=10) "\treturn *x", + (string) (len=1) "}", + (string) "", + (string) (len=62) "// Type implements the github.com/spf13/pFlag Value interface.", + (string) (len=38) "func (x *StartNotZero) Type() string {", + (string) (len=22) "\treturn \"StartNotZero\"", + (string) (len=1) "}", + (string) "" +} diff --git a/generator/example_1.18_test.go b/generator/example_1.18_test.go new file mode 100644 index 00000000..dbf66582 --- /dev/null +++ b/generator/example_1.18_test.go @@ -0,0 +1,22 @@ +//go:build go1.18 +// +build go1.18 + +package generator + +// SumIntsOrFloats sums the values of map m. It supports both int64 and float64 +// as types for map values. +func SumIntsOrFloats[K comparable, V int64 | float64](m map[K]V) V { + var s V + for _, v := range m { + s += v + } + return s +} + +// ChangeType is a type of change detected. +/* ENUM( + Create + Update + Delete +) */ +type ChangeType int diff --git a/generator/generator_1.18_test.go b/generator/generator_1.18_test.go new file mode 100644 index 00000000..45383188 --- /dev/null +++ b/generator/generator_1.18_test.go @@ -0,0 +1,208 @@ +//go:build go1.18 +// +build go1.18 + +package generator + +import ( + "fmt" + "go/parser" + "strings" + "testing" + + "github.com/bradleyjkemp/cupaloy" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var ( + testExampleFiles = map[string]string{ + "og": `example_test.go`, + "1.18": `example_1.18_test.go`, + } +) + +// TestNoStructInputFile +func Test118NoStructFile(t *testing.T) { + input := `package test + // Behavior + type SomeInterface interface{ + + } + ` + g := NewGenerator(). + WithoutSnakeToCamel() + f, err := parser.ParseFile(g.fileSet, "TestRequiredErrors", input, parser.ParseComments) + assert.Nil(t, err, "Error parsing no struct input") + + output, err := g.Generate(f) + assert.Nil(t, err, "Error generating formatted code") + if false { // Debugging statement + fmt.Println(string(output)) + } +} + +// TestNoFile +func Test118NoFile(t *testing.T) { + g := NewGenerator(). + WithoutSnakeToCamel() + // Parse the file given in arguments + _, err := g.GenerateFromFile("") + assert.NotNil(t, err, "Error generating formatted code") +} + +// TestExampleFile +func Test118ExampleFile(t *testing.T) { + g := NewGenerator(). + WithMarshal(). + WithSQLDriver(). + WithCaseInsensitiveParse(). + WithNames(). + WithoutSnakeToCamel() + + for name, testExample := range testExampleFiles { + t.Run(name, func(t *testing.T) { + // Parse the file given in arguments + imported, err := g.GenerateFromFile(testExample) + require.Nil(t, err, "Error generating formatted code") + + outputLines := strings.Split(string(imported), "\n") + cupaloy.SnapshotT(t, outputLines) + + if false { + fmt.Println(string(imported)) + } + }) + } +} + +// TestExampleFile +func Test118NoPrefixExampleFile(t *testing.T) { + g := NewGenerator(). + WithMarshal(). + WithLowercaseVariant(). + WithNoPrefix(). + WithFlag(). + WithoutSnakeToCamel() + for name, testExample := range testExampleFiles { + t.Run(name, func(t *testing.T) { + // Parse the file given in arguments + imported, err := g.GenerateFromFile(testExample) + require.Nil(t, err, "Error generating formatted code") + + outputLines := strings.Split(string(imported), "\n") + cupaloy.SnapshotT(t, outputLines) + + if false { + fmt.Println(string(imported)) + } + }) + } +} + +// TestExampleFile +func Test118NoPrefixExampleFileWithSnakeToCamel(t *testing.T) { + g := NewGenerator(). + WithMarshal(). + WithLowercaseVariant(). + WithNoPrefix(). + WithFlag() + + for name, testExample := range testExampleFiles { + t.Run(name, func(t *testing.T) { + // Parse the file given in arguments + imported, err := g.GenerateFromFile(testExample) + require.Nil(t, err, "Error generating formatted code") + + outputLines := strings.Split(string(imported), "\n") + cupaloy.SnapshotT(t, outputLines) + + if false { + fmt.Println(string(imported)) + } + }) + } +} + +// TestCustomPrefixExampleFile +func Test118CustomPrefixExampleFile(t *testing.T) { + g := NewGenerator(). + WithMarshal(). + WithLowercaseVariant(). + WithNoPrefix(). + WithFlag(). + WithoutSnakeToCamel(). + WithPtr(). + WithSQLNullInt(). + WithSQLNullStr(). + WithPrefix("Custom_prefix_") + for name, testExample := range testExampleFiles { + t.Run(name, func(t *testing.T) { + // Parse the file given in arguments + imported, err := g.GenerateFromFile(testExample) + require.Nil(t, err, "Error generating formatted code") + + outputLines := strings.Split(string(imported), "\n") + cupaloy.SnapshotT(t, outputLines) + + if false { + fmt.Println(string(imported)) + } + }) + } +} + +func Test118AliasParsing(t *testing.T) { + tests := map[string]struct { + input []string + resultingMap map[string]string + err error + }{ + "no aliases": { + resultingMap: map[string]string{}, + }, + "multiple arrays": { + input: []string{ + `!:Bang,a:a`, + `@:AT`, + `&:AND,|:OR`, + }, + resultingMap: map[string]string{ + "a": "a", + "!": "Bang", + "@": "AT", + "&": "AND", + "|": "OR", + }, + }, + "more types": { + input: []string{ + `*:star,+:PLUS`, + `-:less`, + `#:HASH,!:Bang`, + }, + resultingMap: map[string]string{ + "*": "star", + "+": "PLUS", + "-": "less", + "#": "HASH", + "!": "Bang", + }, + }, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + defer func() { + replacementNames = map[string]string{} + }() + err := ParseAliases(tc.input) + if tc.err != nil { + require.Error(t, err) + require.EqualError(t, err, tc.err.Error()) + } else { + require.NoError(t, err) + require.Equal(t, tc.resultingMap, replacementNames) + } + }) + } +} diff --git a/generator/generator_test.go b/generator/generator_test.go index 0e90dba4..9c20d17d 100644 --- a/generator/generator_test.go +++ b/generator/generator_test.go @@ -1,3 +1,6 @@ +//go:build !go1.18 +// +build !go1.18 + package generator import ( @@ -57,8 +60,7 @@ func TestExampleFile(t *testing.T) { require.Nil(t, err, "Error generating formatted code") outputLines := strings.Split(string(imported), "\n") - err = cupaloy.Snapshot(outputLines) - assert.NoError(t, err, "Output must match snapshot") + cupaloy.SnapshotT(t, outputLines) if false { fmt.Println(string(imported)) @@ -78,8 +80,7 @@ func TestNoPrefixExampleFile(t *testing.T) { require.Nil(t, err, "Error generating formatted code") outputLines := strings.Split(string(imported), "\n") - err = cupaloy.Snapshot(outputLines) - assert.NoError(t, err, "Output must match snapshot") + cupaloy.SnapshotT(t, outputLines) if false { fmt.Println(string(imported)) @@ -99,8 +100,7 @@ func TestNoPrefixExampleFileWithSnakeToCamel(t *testing.T) { require.Nil(t, err, "Error generating formatted code") outputLines := strings.Split(string(imported), "\n") - err = cupaloy.Snapshot(outputLines) - assert.NoError(t, err, "Output must match snapshot") + cupaloy.SnapshotT(t, outputLines) if false { fmt.Println(string(imported)) @@ -124,8 +124,7 @@ func TestCustomPrefixExampleFile(t *testing.T) { require.Nil(t, err, "Error generating formatted code") outputLines := strings.Split(string(imported), "\n") - err = cupaloy.Snapshot(outputLines) - assert.NoError(t, err, "Output must match snapshot") + cupaloy.SnapshotT(t, outputLines) if false { fmt.Println(string(imported)) diff --git a/go.mod b/go.mod index eb55689c..3410c670 100644 --- a/go.mod +++ b/go.mod @@ -1,26 +1,41 @@ module github.com/abice/go-enum -go 1.16 +go 1.18 require ( - github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver v1.5.0 // indirect github.com/Masterminds/sprig v2.22.0+incompatible github.com/bradleyjkemp/cupaloy v2.3.0+incompatible github.com/golang/mock v1.6.0 - github.com/google/uuid v1.2.0 // indirect - github.com/huandu/xstrings v1.3.2 // indirect - github.com/imdario/mergo v0.3.12 // indirect github.com/kevinburke/go-bindata v3.23.0+incompatible - github.com/kr/text v0.2.0 // indirect github.com/labstack/gommon v0.3.1 github.com/mattn/goveralls v0.0.11 - github.com/mitchellh/copystructure v1.1.2 // indirect github.com/pkg/errors v0.9.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.7.1 github.com/urfave/cli/v2 v2.4.0 golang.org/x/tools v0.1.10 +) + +require ( + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver v1.5.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/google/uuid v1.2.0 // indirect + github.com/huandu/xstrings v1.3.2 // indirect + github.com/imdario/mergo v0.3.12 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/mattn/go-colorable v0.1.11 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mitchellh/copystructure v1.1.2 // indirect + github.com/mitchellh/reflectwalk v1.0.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect + golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect + golang.org/x/sys v0.0.0-20211103235746-7861aae1554b // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect )