From 7cfbefb9a9d1c4b306b277c0831ac25b970f6701 Mon Sep 17 00:00:00 2001 From: Mickey Reiss Date: Tue, 2 Oct 2018 14:04:46 -0700 Subject: [PATCH] go: Fix regression in enum names --- langs/go/go.go | 2 +- .../go/test_direction.firemodel.go | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/langs/go/go.go b/langs/go/go.go index 6088add..ef95e6c 100644 --- a/langs/go/go.go +++ b/langs/go/go.go @@ -126,7 +126,7 @@ func (m *GoModeler) writeEnum(enum *firemodel.SchemaEnum, sourceCoder firemodel. f.Const().DefsFunc(func(g *jen.Group) { for _, val := range enum.Values { - enumValName := fmt.Sprintf("%s_%s", enumName, val.Name) + enumValName := fmt.Sprintf("%s_%s", enumName, strcase.ToScreamingSnake(val.Name)) if enum.Comment == "" { g.Commentf("TODO: Add comment to %s in firemodel schema.", enumValName) } else { diff --git a/testfixtures/firemodel/TestFiremodelFromSchema/go/test_direction.firemodel.go b/testfixtures/firemodel/TestFiremodelFromSchema/go/test_direction.firemodel.go index 7ff655c..b0b2bff 100644 --- a/testfixtures/firemodel/TestFiremodelFromSchema/go/test_direction.firemodel.go +++ b/testfixtures/firemodel/TestFiremodelFromSchema/go/test_direction.firemodel.go @@ -6,12 +6,12 @@ package firemodel type TestDirection string const ( - // TODO: Add comment to TestDirection_left in firemodel schema. - TestDirection_left TestDirection = "LEFT" - // TODO: Add comment to TestDirection_right in firemodel schema. - TestDirection_right TestDirection = "RIGHT" - // TODO: Add comment to TestDirection_up in firemodel schema. - TestDirection_up TestDirection = "UP" - // TODO: Add comment to TestDirection_down in firemodel schema. - TestDirection_down TestDirection = "DOWN" + // TODO: Add comment to TestDirection_LEFT in firemodel schema. + TestDirection_LEFT TestDirection = "LEFT" + // TODO: Add comment to TestDirection_RIGHT in firemodel schema. + TestDirection_RIGHT TestDirection = "RIGHT" + // TODO: Add comment to TestDirection_UP in firemodel schema. + TestDirection_UP TestDirection = "UP" + // TODO: Add comment to TestDirection_DOWN in firemodel schema. + TestDirection_DOWN TestDirection = "DOWN" )