Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions generator/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ var (
`

const wrapperTemplate = `// Code generated by sqlc-multi-db. DO NOT EDIT.
{{- if .Engine.IsPostgres}}
{{if .Engine.IsPostgres}}
//go:build !js

{{end -}}
{{- end -}}
Comment on lines +57 to +60

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this change fixes the issue of the build tag being on the same line, the resulting generated code will have a blank line before the build tag, which is unconventional. For better adherence to Go styling conventions, it's recommended to place the build tag on the line immediately following the 'generated code' comment, followed by a blank line before the package declaration. This can be achieved by adjusting the template whitespace handling.

Suggested change
{{if .Engine.IsPostgres}}
//go:build !js
{{end -}}
{{- end -}}
{{if .Engine.IsPostgres}}//go:build !js
{{end -}}

package {{.PackageName}}

import (
Expand Down
Loading