Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a minor formatting inconsistency in the generated Go code. It specifically targets the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses a whitespace formatting issue in a Go template. The proposed change is an improvement, but a further refinement is possible to make the template produce perfectly formatted code without relying on post-processing tools like gofumpt. I've added a comment with a suggestion for a more robust solution that handles all cases correctly.
| {{if .Engine.IsPostgres}} | ||
| //go:build !js | ||
|
|
||
| {{- end -}} | ||
| {{- end}} |
There was a problem hiding this comment.
While your change is an improvement over the original code, it still results in output that is missing a blank line in some cases, relying on gofumpt to fix the formatting. A slightly different approach can produce correctly formatted output directly from the template for both cases (when the if is true or false). This improves the template's clarity and robustness.
Consider this alternative structure:
const wrapperTemplate = `// Code generated by sqlc-multi-db. DO NOT EDIT.
{{if .Engine.IsPostgres}}
//go:build !js
{{end -}}
package {{.PackageName}}
...
`This would correctly handle newlines for both branches of the if statement, producing well-formatted code directly.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11 +/- ##
=======================================
Coverage 28.83% 28.83%
=======================================
Files 6 6
Lines 697 697
=======================================
Hits 201 201
Misses 485 485
Partials 11 11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.