Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(codegen/golang): Refactor imports code to match templates #2709

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

kyleconroy
Copy link
Collaborator

Fixes #2707

I took a bigger approach than #2708 to fix this issue. The problem was that the Fields method didn't use the same logic as the Pair method. When a template only called Pair but the import code called Fields, we'd get a mismatch.

To fix this, I created a new method called Pairs that uses the same logic as the Pair method. I updated the import code to call this. It also checks if the Arg is a struct and checks the fields.

This code is really brittle and until we do a large refactoring, we will sadly still run into issues.

@kyleconroy kyleconroy merged commit b83f8da into main Sep 7, 2023
7 checks passed
@kyleconroy kyleconroy deleted the kyle/refactor-imports-code branch September 7, 2023 17:10
positiveblue added a commit to positiveblue/lnd that referenced this pull request Sep 25, 2023
sqlc has now an official dockerhub organization (sqlc). The old org was
the personal dev account, and new images are not uploaded there anymore.

It looks like they formed a company (Riza, Inc) and are dedicating 100%
of their time to the project (which is great news!)

[sqlc v1.21.0](sqlc-dev/sqlc#2709) has a bug
generating unvalid go code (files with unused imports) so we use v1.20.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unused imports generated in querier interfaces.
1 participant