From 11fed4b9c77c64f27f7e77d1738ebef1bb8c239d Mon Sep 17 00:00:00 2001 From: ~wispem-wantex Date: Sat, 14 Feb 2026 18:33:41 -0800 Subject: [PATCH] refactor: create CamelToPascal string helper --- pkg/schema/table.go | 3 +-- pkg/textutils/snake.go | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/schema/table.go b/pkg/schema/table.go index adda822..5e742c9 100644 --- a/pkg/schema/table.go +++ b/pkg/schema/table.go @@ -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. diff --git a/pkg/textutils/snake.go b/pkg/textutils/snake.go index 7aee3ab..5b6187b 100644 --- a/pkg/textutils/snake.go +++ b/pkg/textutils/snake.go @@ -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:] +}