From 5b692803cf76a65fc5d39178c0a36678e69c0e5a Mon Sep 17 00:00:00 2001 From: Sean Liao Date: Wed, 13 Sep 2023 14:43:00 +0100 Subject: [PATCH] modfile: use new go version string format in error message For golang/go#61888 Change-Id: If4056623471edb6fd99d45dcd8a0751d6a54ce1c Reviewed-on: https://go-review.googlesource.com/c/mod/+/527897 LUCI-TryBot-Result: Go LUCI Auto-Submit: Bryan Mills Reviewed-by: Heschi Kreinick Reviewed-by: Bryan Mills --- modfile/rule.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modfile/rule.go b/modfile/rule.go index 930b6c5..e0869fa 100644 --- a/modfile/rule.go +++ b/modfile/rule.go @@ -367,7 +367,7 @@ func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, a } } if !fixed { - errorf("invalid go version '%s': must match format 1.23", args[0]) + errorf("invalid go version '%s': must match format 1.23.0", args[0]) return } } @@ -384,7 +384,7 @@ func (f *File) add(errs *ErrorList, block *LineBlock, line *Line, verb string, a errorf("toolchain directive expects exactly one argument") return } else if strict && !ToolchainRE.MatchString(args[0]) { - errorf("invalid toolchain version '%s': must match format go1.23 or local", args[0]) + errorf("invalid toolchain version '%s': must match format go1.23.0 or local", args[0]) return } f.Toolchain = &Toolchain{Syntax: line}