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: get reports a confusing error message when multiple packages are fetched at a time and one fails #8444

Closed
gopherbot opened this issue Jul 29, 2014 · 2 comments

Comments

@gopherbot
Copy link

by hbhaskaran:

What does 'go version' print?
go version go1.3 linux/amd64

What steps reproduce the problem?

1. Run:  go get -u code.google.com/p/gogoprotobuf/protoc-gen-go
2. Now run:  go get -u code.google.com/p/gogoprotobuf/{proto,protoc-gen-go,gogoproto}

What happened?

Command #1 fails with a clear message that indicates the non-existent URL under the
heading "package code.google.com/p/gogoprotobuf/protoc-gen-go".  Here the
issue is that I mistyped protoc-gen-go instead of protoc-gen-gogo. No issues with the
error message in this step.

package code.google.com/p/gogoprotobuf/protoc-gen-go
        imports code.google.com/p/gogoprotobuf/protoc-gen-go
        imports code.google.com/p/gogoprotobuf/protoc-gen-go: cannot find package "code.google.com/p/gogoprotobuf/protoc-gen-go" in any of:
        /usr/local/go/src/pkg/code.google.com/p/gogoprotobuf/protoc-gen-go (from $GOROOT)
        /home/user1/gocode/src/code.google.com/p/gogoprotobuf/protoc-gen-go (from $GOPATH)

Command #2 is similar to command #1, except it is preceded by a package that does exist. 

Now it prints

package code.google.com/p/gogoprotobuf/proto
        imports code.google.com/p/gogoprotobuf/protoc-gen-go
        imports code.google.com/p/gogoprotobuf/protoc-gen-go
        imports code.google.com/p/gogoprotobuf/protoc-gen-go: cannot find package "code.google.com/p/gogoprotobuf/protoc-gen-go" in any of:
        /usr/local/go/src/pkg/code.google.com/p/gogoprotobuf/protoc-gen-go (from $GOROOT)
        /home/user1/gocode/src/code.google.com/p/gogoprotobuf/protoc-gen-go (from $GOPATH)

The error message lead me to believe the proto package (which installed just fine)
somehow imports protoc-gen-go and Go can't find the import.

What should have happened instead?

The error message should be labeled with the package that failed to import, similar to
Step 1.

Please provide any additional information below.
@ianlancetaylor
Copy link
Contributor

Comment 1:

Labels changed: added repo-main, release-none, suggested.

@gopherbot gopherbot added new Suggested Issues that may be good for new contributors looking for work to do. labels Aug 1, 2014
@bradfitz bradfitz removed the new label Dec 18, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@ysmolski ysmolski removed the Suggested Issues that may be good for new contributors looking for work to do. label Nov 6, 2018
@ysmolski
Copy link
Member

ysmolski commented Nov 6, 2018

This was fixed:

~ % go get -u github.com/gogo/protobuf/{proto,protoc-gen-go,gogoproto}
package github.com/gogo/protobuf/protoc-gen-go: cannot find package "github.com/gogo/protobuf/protoc-gen-go" in any of:
	/Users/thorn/golang/src/github.com/gogo/protobuf/protoc-gen-go (from $GOROOT)
	/Users/thorn/go/src/github.com/gogo/protobuf/protoc-gen-go (from $GOPATH)

@ysmolski ysmolski closed this as completed Nov 6, 2018
@golang golang locked and limited conversation to collaborators Nov 6, 2019
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

5 participants