Skip to content
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

Closed
robpike opened this issue Jan 8, 2015 · 5 comments
Closed

Comments

@robpike
Copy link
Contributor

robpike commented Jan 8, 2015

% 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.

@robpike robpike added this to the Go1.4.1 milestone Jan 8, 2015
@adg adg changed the title unhelpful error message from go get when vanity import has moved cmd/go: unhelpful error message from go get when vanity import has moved Jan 8, 2015
@ianlancetaylor ianlancetaylor changed the title cmd/go: unhelpful error message from go get when vanity import has moved cmd/go: unhelpful error message from go get when custom import has moved Jan 8, 2015
@rsc
Copy link
Contributor

rsc commented Jan 14, 2015

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?

@adg
Copy link
Contributor

adg commented Jan 14, 2015

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?"

@rsc
Copy link
Contributor

rsc commented Jan 14, 2015

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
?

@adg
Copy link
Contributor

adg commented Jan 14, 2015

That's much clearer IMO. LGTM.

On 14 January 2015 at 14:50, Russ Cox notifications@github.com wrote:

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
?


Reply to this email directly or view it on GitHub
#9540 (comment).

@rsc
Copy link
Contributor

rsc commented Jan 14, 2015

Fixed but forgot to write the magic line. https://golang.org/cl/2808

@rsc rsc closed this as completed Jan 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants