]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: fix spurious import resolution error
authorBryan C. Mills <bcmills@google.com>
Sat, 29 Aug 2020 01:32:05 +0000 (21:32 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 9 Sep 2020 21:29:10 +0000 (21:29 +0000)
commitcd91ab5d9601c975286f1ac83cd289e34aa117f8
tree42509239c4f67bd12d56fc72bf75b3d6611a0838
parent2c8d2a0c51f4085e56b5ab05ed9fb17fc6d08261
cmd/go/internal/modload: fix spurious import resolution error

Due to a bug in CL 173017, if QueryPackages found multiple candidates
for the given package and *at least* one of those candidates was not
available to add, we would reject *all* such candidates — even those
that were still viable.

Now, we return the first viable candidate, and only return an error if
*no* candidate is viable given the current build list.

Fixes #41113

Change-Id: Idb2e77244be7c0f5dd511efb142c3059925d7336
Reviewed-on: https://go-review.googlesource.com/c/go/+/251446
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/cmd/go/internal/modload/import.go
src/cmd/go/testdata/mod/example.com_split-incompatible_subpkg_v0.1.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_split-incompatible_v2.0.0+incompatible.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_split-incompatible_v2.1.0-pre+incompatible.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_import_issue41113.txt [new file with mode: 0644]