x/tools/cmd/goimports: treat import paths as standard library only if they are in goroot #12419
Labels
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
The go tool sets a field to indicate whether a package is part of the standard library:
https://github.com/golang/go/blob/8d478e845c/src/cmd/go/pkg.go#L156
goimports uses a different rule:
https://github.com/golang/tools/blob/e21b7325f7/imports/fix.go#L32
My feature request is to change the code to behave similar to the go tool:
With an additional index of the standard library keyed by import path, I'd expect this to be reasonably fast.
If this is an acceptable idea, I'm happy to write a patch.
The text was updated successfully, but these errors were encountered: