Commit a9ba734e authored by Jay Conrod's avatar Jay Conrod Committed by Dmitri Shuralyov
Browse files

[release-branch.go1.16] cmd/go/internal/modload: don't query when fixing canonical versions

If a canonical version is passed to fixVersion when loading the main
go.mod and that version don't match the module path's major version
suffix, don't call Query.

Query doesn't return a useful error in this case when the path is
malformed, for example, when it doens't have a dot in the first path
element. It's better to report the major version mismatch error.

Fixes #44496

Change-Id: I97b1f64aee894fa0db6fb637aa03a51357ee782c
Reviewed-on: https://go-review.googlesource.com/c/go/+/296590


Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
(cherry picked from commit 5fafc0bb)
Reviewed-on: https://go-review.googlesource.com/c/go/+/297989


Reviewed-by: default avatarDmitri Shuralyov <dmitshur@golang.org>
parent 047ca229
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment