Skip to content

Fix struct validation for multiple files#65

Closed
mikeschinkel wants to merge 1 commit intovburenin:masterfrom
mikeschinkel:fix-struct-validation
Closed

Fix struct validation for multiple files#65
mikeschinkel wants to merge 1 commit intovburenin:masterfrom
mikeschinkel:fix-struct-validation

Conversation

@mikeschinkel
Copy link
Copy Markdown
Contributor

Using the following command line where persister contains files generated by sqlc, your latest commit in master fails to correctly generate the file ./app/query.iface.go because it cannot find the struct Queries in the first .go file.

ifacemaker -f ./persister/*.go -s Queries -i DataStoreQueries -p app -o ./app/query.iface.go

I moved the if !validateStructType(...) {...} to after the for loop and passed allDeclaredTypes instead of types and it allowed the file to be generated. I believe this is all that is needed for a fix.

@gaby
Copy link
Copy Markdown
Collaborator

gaby commented Mar 15, 2025

Closing in favor of #72

@gaby gaby closed this Mar 15, 2025
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.

2 participants