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/astutil: use goimports import path to import name heuristic in UsesImport #30331
goimports has a sophisticated heuristic to guess a package import name from its import path. We might even eventually enshrine that heuristic in the language (#29036).
astutil.UsesImport uses a much less sophisticated heuristic. We should move the goimports heuristic to somewhere exported (maybe in astutil?) and use it in astutil.UsesImport.
(astutil.UsesImport could also use some expanded docs, but that is another matter.)
I think the original issue isn't about
I have a local WIP commit that mentions
I'll copy the commit message here, since it's relevant: