diff options
author | Jay Conrod <jayconrod@google.com> | 2019-05-31 18:56:28 -0400 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2019-06-14 18:01:34 +0000 |
commit | 4c2ffd26ec3fe2fb9552b5a38c2b731e86a85abf (patch) | |
tree | 717c4be2f345ecd5614499e284afe758cdf900ce /src/cmd/go/internal/mvs/mvs.go | |
parent | 80f89133ea54b96d491f8780daaac253ed09abe9 (diff) | |
download | go-4c2ffd26ec3fe2fb9552b5a38c2b731e86a85abf.tar.gz go-4c2ffd26ec3fe2fb9552b5a38c2b731e86a85abf.zip |
cmd/go: avoid accidental downgrades in 'go get' with latest and patch
Currently, 'go get -u' and 'go get -u=patch' avoid accidentally
downgrading modules by preventing upgrades in two cases:
1) If the current version is a prerelease that is semantically later
than the "latest" or "patch" version.
2) If the current version is a pseudoversion that is chronologically
newer than the "latest" or "patch" version.
With this change, 'go get m@latest' and 'go get m@patch' prevent
downgrades using the same checks.
Also: 'go get m@patch' now works if m is a module path but not a
package path (i.e., there is no package in the module root directory).
Fixes #30634
Fixes #32537
Change-Id: I916630c385b5f3ba7c13e0d65ba08f73a1a67829
Reviewed-on: https://go-review.googlesource.com/c/go/+/180337
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/mvs/mvs.go')
-rw-r--r-- | src/cmd/go/internal/mvs/mvs.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/mvs/mvs.go b/src/cmd/go/internal/mvs/mvs.go index 04273e733c..dca909e858 100644 --- a/src/cmd/go/internal/mvs/mvs.go +++ b/src/cmd/go/internal/mvs/mvs.go @@ -35,7 +35,7 @@ type Reqs interface { // Max returns the maximum of v1 and v2 (it returns either v1 or v2). // // For all versions v, Max(v, "none") must be v, - // and for the tanget passed as the first argument to MVS functions, + // and for the target passed as the first argument to MVS functions, // Max(target, v) must be target. // // Note that v1 < v2 can be written Max(v1, v2) != v1 |