From 7d93bee4bdcc3960b1ab0a6e0738ab0d4324907e Mon Sep 17 00:00:00 2001 From: Hein Date: Sat, 18 Jul 2026 22:41:23 +0200 Subject: [PATCH] chore: Fixed linitng issues --- cmd/relspec/convert.go | 2 +- pkg/assetloader/executor.go | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cmd/relspec/convert.go b/cmd/relspec/convert.go index 08c798a..8754c25 100644 --- a/cmd/relspec/convert.go +++ b/cmd/relspec/convert.go @@ -393,7 +393,7 @@ func writeDatabase(db *models.Database, dbType, outputPath, packageName, schemaF writerOpts := newWriterOptions(outputPath, packageName, flattenSchema, nullableTypes, continueOnError) if extraFields != "" { - if strings.ToLower(dbType) != "bun" { + if !strings.EqualFold(dbType, "bun") { return fmt.Errorf("--extra-fields is only supported for Bun output") } extraFieldsJSON, err := os.ReadFile(extraFields) diff --git a/pkg/assetloader/executor.go b/pkg/assetloader/executor.go index 236fdc7..f18579b 100644 --- a/pkg/assetloader/executor.go +++ b/pkg/assetloader/executor.go @@ -29,15 +29,14 @@ const pgCastMarker = "\x00PGCAST\x00" // A placeholder that appears more than once maps to the same $N. An unknown // placeholder (not built-in and not in staticParams) returns an error. // PostgreSQL cast syntax (::type) is left untouched. -func BuildQuery(call string, fileBytes []byte, filename string, staticParams map[string]string) (string, []any, error) { +func BuildQuery(call string, fileBytes []byte, filename string, staticParams map[string]string) (query string, args []any, err error) { // Protect :: casts before running the placeholder regex. protected := strings.ReplaceAll(call, "::", pgCastMarker) paramIndex := map[string]int{} // name → 1-based position - var args []any var firstErr error - result := namedPlaceholder.ReplaceAllStringFunc(protected, func(match string) string { + query = namedPlaceholder.ReplaceAllStringFunc(protected, func(match string) string { if firstErr != nil { return match } @@ -78,9 +77,9 @@ func BuildQuery(call string, fileBytes []byte, filename string, staticParams map } // Restore :: casts. - result = strings.ReplaceAll(result, pgCastMarker, "::") + query = strings.ReplaceAll(query, pgCastMarker, "::") - return result, args, nil + return query, args, nil } // ExecuteItem reads the asset file referenced by item.Entry.File (which is the