Skip to content

x/tools/goimports: enable deleting without adding missing imports #76745

@ikonst

Description

@ikonst

Adding missing imports can take substantial time (~ 30-60 seconds in a large codebase) due to the need to load packages. This makes goimports problematic for "action on save" workflows, as saves would either block the editor or (if async) risk undoing user's work (when goimports eventually finishes and writes back the file).

I'd like to propose another flag, -delete-only, that'll produce only DeleteImport fixes, since I would assume that DeleteImport fixes can be produced quickly without loading packages either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.RefactoringIssues related to refactoring toolsToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions