]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: return a module-only result from QueryPattern
authorBryan C. Mills <bcmills@google.com>
Fri, 30 Oct 2020 16:24:51 +0000 (12:24 -0400)
committerBryan C. Mills <bcmills@google.com>
Thu, 5 Nov 2020 16:46:56 +0000 (16:46 +0000)
commit04b5b4f740a34a95a10253a0e34779bb259ec9c4
treedb270568beafe25756252ba20239e5189b23a757
parent40f0359d52e04ed124a8f81e1ef8ac86957dd983
cmd/go/internal/modload: return a module-only result from QueryPattern

This allows a single QueryPattern call to resolve a path that could be
either a package or a module. It is important to be able to make a
single QueryPattern call — rather than a QueryPattern followed by a
Query for the specific module path — to provide appropriate fallback
behavior: if the proxy returns package results but does not contain a
module result, we don't want to fall back to the next proxy to look
for the (probably-nonexistent) module.

For #37438

Change-Id: I419b8bb3ab4565f443bb5cee9a8b206f453b9801
Reviewed-on: https://go-review.googlesource.com/c/go/+/266657
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modload/import.go
src/cmd/go/internal/modload/query.go
src/cmd/go/internal/work/build.go
src/cmd/go/testdata/script/mod_get_downgrade_missing.txt