Skip to content

Support cleaning up unused imports #22

Open

Description

@mjpitz

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.

Activity

  1. self-assigned this
    on Oct 27, 2020
  2. cnmcavoy commented on Oct 27, 2020

    @cnmcavoy
    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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions