Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/cmd/goimports: prefer golang.org/x/net/context #15471
I think a more general solution would be useful - I hit this all the time, but not only with
I propose allowing the user to specify (preferably via a config file, but command line would also work) preferences for mapping package names to import path. For packages that show up there, those import paths are preferred.
To follow up to the previous comment, I found out there is already support for a
Edit: never mind, I tried it and adding
I don't think it's (specifically) about Go versions. As @RaduBerinde pointed out, and as I often experience, it's also about importing the "wrong" version of many libraries (
What I would like is the option to give goimports hints as to which package to prefer. This might be expressed by a simple ordered list:
goimports would then use the first one to match its detected signature.
Ideally, this could also be configured on a per-package/workspace basis (i.e. a