New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: unhelpful error message from go get when custom import has moved #9540
Comments
We don't know exactly what went wrong. We can't say that the custom import changed target, because maybe it was never code.google.com/p/go.net and you just happened to run an hg command to populate /Users/r/src/golang.org/x/net from there. We could suggest removing the directory and re-running go get, but that assumes there are no changes that need to be kept. I am always wary of tools suggesting that people remove directories: people will do it blindly. We could make the error more explicit about the operations, saying imports golang.org/x/net/context: /Users/r/src/golang.org/x/net is checked out from https://code.google.com/p/go.net, but golang.org/x/net should be checked out from https://go.googlesource.com/net Is that enough to make the problem clearer? |
Perhaps the message should say why "golang.org/x/net should be checked out from xxx". Otherwise it's like "uhh, but why should it be checked out from there?" |
golang.org/x/net is a custom import path for https://go.googlesource.com/net, but /Users/r/src/golang.org/x/net is checked out from https://code.google.com/p/go.net |
That's much clearer IMO. LGTM. On 14 January 2015 at 14:50, Russ Cox notifications@github.com wrote:
|
Fixed but forgot to write the magic line. https://golang.org/cl/2808 |
% go get -u rsc.io/github/issue
package rsc.io/github/issue
imports 9fans.net/go/acme
imports 9fans.net/go/plan9
imports 9fans.net/go/plan9/client
imports 9fans.net/go/draw
imports 9fans.net/go/draw/drawfcall
imports github.com/google/go-github/github
imports github.com/google/go-querystring/query
imports golang.org/x/oauth2
imports golang.org/x/net/context: /Users/r/src/golang.org/x/net is from https://code.google.com/p/go.net, should be from https://go.googlesource.com/net
The error is the last line, but "should be" doesn't tell me much, as this is a transitive dependency I don't know about. It should say something about what went wrong (vanity import has changed target) or how to fix it (remove stale repo) or .... ?
I found this difficult to understand but easy to fix, implying the error message could be improved.
The text was updated successfully, but these errors were encountered: