Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/cmd/goimports: treat import paths as standard library only if they are in goroot #12419
The go tool sets a field to indicate whether a package is part of the standard library:
goimports uses a different rule:
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.