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

Add imports processing when formating source files to remove unused imports #1438

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

eklatzer
Copy link

@eklatzer eklatzer commented Feb 2, 2025

Fixes #1279

@stephenafamo
Copy link
Collaborator

I'm unsure how this fixes the issue

@parnic
Copy link
Contributor

parnic commented Mar 29, 2025

I'm unsure how this fixes the issue

The report is that an unused import can be generated in the file, leading to Go compile errors. This PR appears to post-process the file after it has been generated and run it through Go's own imports processor which will, I assume, remove the unused import.

https://pkg.go.dev/golang.org/x/tools/imports#Process

@eklatzer
Copy link
Author

@parnic You are correct, thanks for clarifying.
@stephenafamo Any further questions regarding this PR?

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 import "database/sql" in view models
3 participants