From b665ab59b1ca9a3cdde266de0f1c28797ea7d0c6 Mon Sep 17 00:00:00 2001 From: jdl Date: Thu, 25 Jun 2026 13:55:11 +0200 Subject: [PATCH] WIP --- gen.go.tmpl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gen.go.tmpl b/gen.go.tmpl index 9476612..1a5fad1 100644 --- a/gen.go.tmpl +++ b/gen.go.tmpl @@ -29,13 +29,13 @@ const {{.LowerType}}_SelectQuery = "{{.SelectQuery}}" func {{.LowerType}}_Insert( tx dbConn, row {{.Type}}, -) (row {{.Type}}, err error) { +) ({{.Type}}, error) { row = {{.LowerType}}_Sanitize(row) - if err = {{.LowerType}}_Validate(row); err != nil { + if err := {{.LowerType}}_Validate(row); err != nil { return row, err } - _, err = tx.Exec("{{.InsertQuery}}", {{.InsertArgs}}) + _, err := tx.Exec("{{.InsertQuery}}", {{.InsertArgs}}) return row, err } @@ -48,9 +48,9 @@ func {{.LowerType}}_Insert( func {{.LowerType}}_Update( tx dbConn, row {{.Type}}, -) (row {{.Type}}, err error) { +) ({{.Type}}, error) { row = {{.LowerType}}_Sanitize(row) - if err = {{.LowerType}}_Validate(row); err != nil { + if err := {{.LowerType}}_Validate(row); err != nil { return row, err } @@ -79,9 +79,9 @@ func {{.LowerType}}_Update( func {{.LowerType}}_UpdateFull( tx dbConn, row {{.Type}}, -) (row {{.Type}}, err error) { +) ({{.Type}}, error) { row = {{.LowerType}}_Sanitize(row) - if err = {{.LowerType}}_Validate(row); err != nil { + if err := {{.LowerType}}_Validate(row); err != nil { return row, err }