Skip to content

Commit 83b51fa

Browse files
committed
Correctly capitalize struct fields ending in '_gb'
1 parent 22f7c35 commit 83b51fa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/codegen/golang/struct.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ func StructName(name string, settings config.CombinedSettings) string {
2020
}
2121
out := ""
2222
for _, p := range strings.Split(name, "_") {
23-
if p == "id" {
23+
switch p {
24+
case "id":
2425
out += "ID"
25-
} else {
26+
case "gb":
27+
out += "GB"
28+
default:
2629
out += strings.Title(p)
2730
}
2831
}

0 commit comments

Comments
 (0)