Skip to content

Commit 6f783cd

Browse files
authored
chore: fix extra newline in comments for copyfrom (#1438)
1 parent 194065e commit 6f783cd

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

internal/codegen/golang/templates/pgx/copyfromCopy.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ func (r iteratorFor{{.MethodName}}) Err() error {
3737

3838
{{range .Comments}}//{{.}}
3939
{{end -}}
40-
{{- if $.EmitMethodsWithDBArgument}}
40+
{{- if $.EmitMethodsWithDBArgument -}}
4141
func (q *Queries) {{.MethodName}}(ctx context.Context, db DBTX, {{.Arg.SlicePair}}) (int64, error) {
4242
return db.CopyFrom(ctx, {{.TableIdentifier}}, {{.Arg.ColumnNames}}, &iteratorFor{{.MethodName}}{rows: {{.Arg.Name}}})
43-
{{- else}}
43+
{{- else -}}
4444
func (q *Queries) {{.MethodName}}(ctx context.Context, {{.Arg.SlicePair}}) (int64, error) {
4545
return q.db.CopyFrom(ctx, {{.TableIdentifier}}, {{.Arg.ColumnNames}}, &iteratorFor{{.MethodName}}{rows: {{.Arg.Name}}})
4646
{{- end}}

internal/endtoend/testdata/copyfrom/postgresql/pgx/go/copyfrom.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/endtoend/testdata/copyfrom/postgresql/pgx/query.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ CREATE SCHEMA myschema;
22
CREATE TABLE myschema.foo (a text, b integer);
33

44
-- name: InsertValues :copyfrom
5+
-- InsertValues inserts multiple values using copy.
56
INSERT INTO myschema.foo (a, b) VALUES ($1, $2);
67

78
-- name: InsertSingleValue :copyfrom
9+
-- InsertSingleValue inserts a single value using copy.
810
INSERT INTO myschema.foo (a) VALUES ($1);

0 commit comments

Comments
 (0)