]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.13] cmd/go: suppress more errors in package-to-module loading
authorBryan C. Mills <bcmills@google.com>
Tue, 8 Oct 2019 18:23:43 +0000 (14:23 -0400)
committerAlexander Rakoczy <alex@golang.org>
Wed, 9 Oct 2019 15:10:17 +0000 (15:10 +0000)
commit842a1e78c9533254d8d82a5571bdf24c0168beb3
tree0fc7caf8f1e42b4da1ab24a476bc9263013c59c5
parent2f73eedd42b509e3aa262fb2846105d3b5cee986
[release-branch.go1.13] cmd/go: suppress more errors in package-to-module loading

In CL 197059, I suppressed errors if the target package was already found.
However, that does not cover the case of passing a '/v2' module path to
'go get' when the module does not contain a package at its root.

This CL is a minimal fix for that case, intended to be backportable to 1.13.

(Longer term, I intend to rework the version-validation check to treat
all mismatched paths as ErrNotExist.)

Updates #34746
Fixes #34747

Change-Id: Ia963c2ea00fae424812b8f46a4d6c2c668252147
Reviewed-on: https://go-review.googlesource.com/c/go/+/199839
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
(cherry picked from commit 421d35cf69f4a18edf96004ba99c01e629a0f79f)
Reviewed-on: https://go-review.googlesource.com/c/go/+/199997
src/cmd/go/internal/modload/query.go
src/cmd/go/testdata/script/mod_get_major.txt