You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sqlc generates empty imports statement, e.g. "import ()" #3134
When there are no imports to generate, sqlc generates two (2) unnecessary lines:
import ()
<blankline>
This is a problem when running this command in CI as gotfmt will remove that empty import and the blank line that follows:
gofmt -s -w .&& git diff --exit-code
This is a simple fix; add a hasImports method for use by the template and then wrap every place in templates that generate imports with {{ if hasImports .SourceName }}. After submitting this issue I will submit a PR to fix this issue.
Activity
Avoid generating empty Go imports statement
feat(generate): Avoid generating empty Go imports (#3135)
feat(generate): Avoid generating empty Go imports (sqlc-dev#3135)
feat(generate): Avoid generating empty Go imports (sqlc-dev#3135)