x/tools/go/analysis/internal/checker: -fix should remove unneeded imports #72035
Labels
ToolProposal
Issues describing a requested change to a Go tool or command-line program.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
The -fix flag of each {single,multi}checker tool applies as many fixes as possible without textual conflicts. However, semantic conflicts are still possible. The most common kind of semantic conflict is to leave unused imports in the file. Consider: if a file contains two fixes, each of which removes one use of an import, then each fix is safe to apply in isolation, but when applied together the import becomes unused.
This is sufficiently common that it is worth making the fixer's final step to check for unused imports and remove them, ideally without having to re-typecheck the file.
The text was updated successfully, but these errors were encountered: