From e75aef80ca3722684e707502c424c0fb28e8b1cc Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Wed, 11 Nov 2020 16:59:55 -0500 Subject: [PATCH] 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 Run-TryBot: Jay Conrod TryBot-Result: Go Bot Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/modfetch/cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/go/internal/modfetch/cache.go b/src/cmd/go/internal/modfetch/cache.go index b7aa670250c..7572ff24f86 100644 --- a/src/cmd/go/internal/modfetch/cache.go +++ b/src/cmd/go/internal/modfetch/cache.go @@ -483,7 +483,7 @@ func readDiskStatByHash(path, rev string) (file string, info *RevInfo, err error for _, name := range names { if strings.HasSuffix(name, suffix) { v := strings.TrimSuffix(name, ".info") - if IsPseudoVersion(v) && semver.Max(maxVersion, v) == v { + if IsPseudoVersion(v) && semver.Compare(v, maxVersion) > 0 { maxVersion = v file, info, err = readDiskStat(path, strings.TrimSuffix(name, ".info")) }