refactor: create CamelToPascal string helper

This commit is contained in:
~wispem-wantex 2026-02-14 18:33:41 -08:00
parent 4e0836eb2e
commit 11fed4b9c7
2 changed files with 5 additions and 2 deletions

View File

@ -58,8 +58,7 @@ func (c Column) GoVarName() string {
// LongGoVarName returns a lowercased version of the field name (Pascal => Camel).
func (c Column) LongGoVarName() string {
fieldname := c.GoFieldName()
return strings.ToLower(fieldname)[0:1] + fieldname[1:]
return textutils.CamelToPascal(c.GoFieldName())
}
// Table is a single SQLite table.

View File

@ -9,3 +9,7 @@ func SnakeToCamel(s string) string {
}
return strings.Join(parts, "")
}
func CamelToPascal(s string) string {
return strings.ToLower(s)[0:1] + s[1:]
}