From 6ba1d90df56cc0f30557863aa8418c54885abb14 Mon Sep 17 00:00:00 2001 From: Zeke Lu Date: Sat, 27 Aug 2022 10:27:05 +0800 Subject: [PATCH] cmd/go/internal/modfetch: report error on failing to derive pseudo version from recent tag The current implementation ignores the error when it tries to get the recent tag on revisions, which results in incorrect pseudo version (v0.0.0-) is derived. --- src/cmd/go/internal/modfetch/coderepo.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cmd/go/internal/modfetch/coderepo.go b/src/cmd/go/internal/modfetch/coderepo.go index 8fb0035f8c0..138c00da19e 100644 --- a/src/cmd/go/internal/modfetch/coderepo.go +++ b/src/cmd/go/internal/modfetch/coderepo.go @@ -607,7 +607,10 @@ func (r *codeRepo) convert(info *codehost.RevInfo, statVers string) (*RevInfo, e return !isRetracted(v) } if pseudoBase == "" { - tag, _ := r.code.RecentTag(info.Name, tagPrefix, tagAllowed) + tag, err := r.code.RecentTag(info.Name, tagPrefix, tagAllowed) + if err != nil { + return nil, err + } if tag != "" { pseudoBase, _ = tagToVersion(tag) }