]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: avoid using the global build list in QueryPattern
authorBryan C. Mills <bcmills@google.com>
Mon, 12 Oct 2020 19:32:49 +0000 (15:32 -0400)
committerBryan C. Mills <bcmills@google.com>
Fri, 16 Oct 2020 19:13:40 +0000 (19:13 +0000)
commit41162be44a099803a870f9b6c147050594598d63
tree1334c5d56452736e9b6ea9981388064bbc671496
parentff052737a946b5f9381dc054d61857ee4d500899
cmd/go/internal/modload: avoid using the global build list in QueryPattern

The Query function allows the caller to specify the current version of
the requested module, but the QueryPattern function is missing that
parameter: instead, it always assumes that the current version is the
one selected from the global build list.

This change removes that assumption, instead adding a callback
function to determine the current version. (The callback is currently
invoked once per candidate module, regardless of whether that module
exists, but in a future change we can refactor it to invoke the
callback only when needed.)

For #36460
For #40775

Change-Id: I001a4a8ab24f5b4fcc66a670d9bd305b47e948ba
Reviewed-on: https://go-review.googlesource.com/c/go/+/261640
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>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modload/buildlist.go
src/cmd/go/internal/modload/import.go
src/cmd/go/internal/modload/modfile.go
src/cmd/go/internal/modload/query.go
src/cmd/go/internal/work/build.go