]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.9] cmd/go: fix 'go get' compatibility for direct download of...
authorRuss Cox <rsc@golang.org>
Fri, 1 Jun 2018 19:47:29 +0000 (15:47 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 4 Jun 2018 16:21:11 +0000 (16:21 +0000)
commit91f0e20ecbff8c7744c7b8a7a6a4582a3bfef5a2
tree241c9ca9861c879f6c19bf16396bfab3f779e88c
parent05604d7450b7cfcd946762039ee46e9ab85297d6
[release-branch.go1.9] cmd/go: fix 'go get' compatibility for direct download of vgo-aware module

CL 109340 added “minimal module-awareness for legacy operation.”
One part of that is reinterpreting imports inside code trees with go.mod files
as using semantic import versioning, and converting them back to
legacy import paths by stripping the major version element
(for example, interpreting import "x.com/foo/v2/bar" as import "x.com/foo/bar").
This rewrite was not being applied during "go get", with the effect that once
you had the target code downloaded already, everything was fine,
but it didn't download and build successfully the first time.

Fixes #25687.
Cherry-pick fixes #25691.

Change-Id: I3e122efdc8fd9a0a4e66f5aa3e6a99f90c7df779
Reviewed-on: https://go-review.googlesource.com/115797
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-on: https://go-review.googlesource.com/116175
src/cmd/go/internal/get/get.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/vendor_test.go