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: go get gives confusing error message when package is not a hostname #7432

Closed
davecheney opened this issue Feb 28, 2014 · 4 comments
Closed
Milestone

Comments

@davecheney
Copy link
Contributor

What steps will reproduce the problem?

lucky(~) % go get -v src/launchpad.net/gocheck/
import "src/launchpad.net/gocheck": import path doesn't contain a hostname
package src/launchpad.net/gocheck: unrecognized import path
"src/launchpad.net/gocheck"

What is the expected output? What do you see instead?

go get should choose to return only one of these error messages, preferably the first.

Please use labels and text to provide additional information.
@gopherbot
Copy link

Comment 1 by mistobaan:

I looked into this and seems that the double message is an expected behavior.
See: https://code.google.com/p/go/source/browse/src/cmd/go/vcs.go#364 
Same thing happen if you do:
./go get -d -v src
import "src": import path doesn't contain a slash
package src: unrecognized import path "src"
The comment says;
                // repoRootForImportDynamic returns error detail
        // that is irrelevant if the user didn't intend to use a
        // dynamic import in the first place.
        // Squelch it.
I don't fully understand the full context here, but for those kind of errors I think the
detailed
message make more sense than the generic obscure one.

@rsc
Copy link
Contributor

rsc commented May 27, 2014

Comment 2:

Labels changed: added release-go1.4, removed release-go1.3maybe.

@gopherbot
Copy link

Comment 3:

CL https://golang.org/cl/144650043 mentions this issue.

@rsc
Copy link
Contributor

rsc commented Sep 26, 2014

Comment 4:

This issue was closed by revision b86105e.

Status changed to Fixed.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
If you say 'go get -v' you get extra information when import
paths are not of the expected form.

If you say 'go get -v src/rsc.io/pdf' the message says that
src/rsc.io/pdf does not contain a hostname, which is incorrect.
The problem is that it does not begin with a hostname.

Fixes golang#7432.

LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/144650043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 26, 2018
If you say 'go get -v' you get extra information when import
paths are not of the expected form.

If you say 'go get -v src/rsc.io/pdf' the message says that
src/rsc.io/pdf does not contain a hostname, which is incorrect.
The problem is that it does not begin with a hostname.

Fixes golang#7432.

LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/144650043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
If you say 'go get -v' you get extra information when import
paths are not of the expected form.

If you say 'go get -v src/rsc.io/pdf' the message says that
src/rsc.io/pdf does not contain a hostname, which is incorrect.
The problem is that it does not begin with a hostname.

Fixes golang#7432.

LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/144650043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 30, 2018
If you say 'go get -v' you get extra information when import
paths are not of the expected form.

If you say 'go get -v src/rsc.io/pdf' the message says that
src/rsc.io/pdf does not contain a hostname, which is incorrect.
The problem is that it does not begin with a hostname.

Fixes golang#7432.

LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/144650043
This issue was closed.
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

3 participants