Skip to content

Commit 6aac054

Browse files
feat(codegen): preserve casing of names by uppercasing only the first character instead of using strings.Title
1 parent 21e6557 commit 6aac054

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/codegen/golang/struct.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ func StructName(name string, options *opts.Options) string {
3535
if _, found := options.InitialismsMap[p]; found {
3636
out += strings.ToUpper(p)
3737
} else {
38-
out += strings.Title(p)
38+
if len(p) > 0 {
39+
out += strings.ToUpper(p[:1]) + p[1:]
40+
}
3941
}
4042
}
4143

0 commit comments

Comments
 (0)