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 fetches packages which are vendored #12112

Closed
pwaller opened this issue Aug 11, 2015 · 4 comments
Closed

cmd/go: go get fetches packages which are vendored #12112

pwaller opened this issue Aug 11, 2015 · 4 comments

Comments

@pwaller
Copy link
Contributor

pwaller commented Aug 11, 2015

GO15VENDOREXPERIMENT=1

Related, but separate: #12111

Over here, I have a demo package: https://github.com/pwaller/vendor-collision

If you go get -v github.com/pwaller/vendor-collision:

$ go get -v github.com/pwaller/vendor-collision
Fetching https://vendor.org/p/vendor/example.org/library?go-get=1
https fetch failed.
import "vendor.org/p/vendor/example.org/library": https fetch: Get https://vendor.org/p/vendor/example.org/library?go-get=1: read tcp 192.168.0.108:58977->69.172.201.208:443: read: connection reset by peer
package vendor.org/p/vendor/example.org/library: unrecognized import path "vendor.org/p/vendor/example.org/library"

The surprising thing here is that it tries to fetch packages from vendor.org even though they are already available in /vendor/.

For the purposes of this bug, the only feature of the repository that matters is that there is vendor-collision/main.go which imports vendor.org/p which lives at vendor-collision/vendor/vendor.org/p.

@kardianos
Copy link
Contributor

The error message could be improved. However you are doing something illigal with the GO15VENDOREXPERIMENT on. The following import path should not contain the /vendor/ element.

https://github.com/pwaller/vendor-collision/blob/a74a28c9c86280739303d927795521a68deee65c/vendor/vendor.org/p/p.go#L4

@pwaller
Copy link
Contributor Author

pwaller commented Aug 11, 2015

@kardianos I think I wasn't clear enough on the purpose of this report. The bug happens regardless of the content of vendor.org/p, even if it does not have /vendor/ in it. The issue is that it is fetching from vendor.org at all.

@kardianos
Copy link
Contributor

I suppose I don't understand this bug report then. Could you provide a repo that contains valid import paths for the vendor experiment that is affected by this issue? I mean, to "fetch" from vendor.org it would need an http meta header to describe the location. If you mean find locally, it would need a valid import path.

@pwaller
Copy link
Contributor Author

pwaller commented Aug 11, 2015

Oh! @kardianos I apologise, you're right. If I remove the vendor.org/p/vendor/example.org/lib import then it doesn't have the unexpected behaviour.

Closing this one as invalid.

@pwaller pwaller closed this as completed Aug 11, 2015
@golang golang locked and limited conversation to collaborators Aug 10, 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

3 participants