aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modload/modfile.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2020-10-12 15:32:49 -0400
committerBryan C. Mills <bcmills@google.com>2020-10-16 19:13:40 +0000
commit41162be44a099803a870f9b6c147050594598d63 (patch)
tree1334c5d56452736e9b6ea9981388064bbc671496 /src/cmd/go/internal/modload/modfile.go
parentff052737a946b5f9381dc054d61857ee4d500899 (diff)
downloadgo-41162be44a099803a870f9b6c147050594598d63.tar.gz
go-41162be44a099803a870f9b6c147050594598d63.zip
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>
Diffstat (limited to 'src/cmd/go/internal/modload/modfile.go')
-rw-r--r--src/cmd/go/internal/modload/modfile.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/modload/modfile.go b/src/cmd/go/internal/modload/modfile.go
index d15da892e6..006db4f169 100644
--- a/src/cmd/go/internal/modload/modfile.go
+++ b/src/cmd/go/internal/modload/modfile.go
@@ -116,7 +116,7 @@ func checkRetractions(ctx context.Context, m module.Version) error {
// Ignore exclusions from the main module's go.mod.
// We may need to account for the current version: for example,
// v2.0.0+incompatible is not "latest" if v1.0.0 is current.
- rev, err := Query(ctx, path, "latest", findCurrentVersion(path), nil)
+ rev, err := Query(ctx, path, "latest", Selected(path), nil)
if err != nil {
return &entry{nil, err}
}