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

Support cleaning up unused imports #22

Open
mjpitz opened this issue Oct 27, 2020 · 1 comment
Open

Support cleaning up unused imports #22

mjpitz opened this issue Oct 27, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@mjpitz
Copy link
Collaborator

mjpitz commented Oct 27, 2020

Right now, I find myself needing both this tool and goimports. As far as I can tell, the only thing goimports does that go-groups does not is clean up unused imports. It would be nice if go-groups supported this as it would drop the need for goimports almost entirely.

@cnmcavoy cnmcavoy added the enhancement New feature or request label Oct 27, 2020
@cnmcavoy cnmcavoy self-assigned this Oct 27, 2020
@cnmcavoy
Copy link
Member

Note for myself, the actual goimports logic to remove imports is here: https://github.com/golang/tools/blob/master/internal/imports/fix.go#L400

It looks like go-groups would have to make the jump from string parsing to ast parsing the input source files to achieve this. I'll definitely look into this, but it's not a trivial improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants