1
0
mirror of https://github.com/golang/go synced 2024-11-26 04:27:58 -07:00

cmd/go: migrate away from semver.Max

For #32700

Change-Id: Ib5cd7004e4558bebebc5f9e7c9263d720c590845
Reviewed-on: https://go-review.googlesource.com/c/go/+/269338
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
Jay Conrod 2020-11-11 16:59:55 -05:00
parent 9ef65ff137
commit e75aef80ca

View File

@ -483,7 +483,7 @@ func readDiskStatByHash(path, rev string) (file string, info *RevInfo, err error
for _, name := range names { for _, name := range names {
if strings.HasSuffix(name, suffix) { if strings.HasSuffix(name, suffix) {
v := strings.TrimSuffix(name, ".info") v := strings.TrimSuffix(name, ".info")
if IsPseudoVersion(v) && semver.Max(maxVersion, v) == v { if IsPseudoVersion(v) && semver.Compare(v, maxVersion) > 0 {
maxVersion = v maxVersion = v
file, info, err = readDiskStat(path, strings.TrimSuffix(name, ".info")) file, info, err = readDiskStat(path, strings.TrimSuffix(name, ".info"))
} }