Update toolchain version regex

Allow release candidate versions.
This commit is contained in:
Owen Mansel-Chan
2025-01-14 10:23:44 +00:00
parent b8cad66287
commit cc459cd80e

View File

@@ -193,7 +193,7 @@ func findGoModFiles(root string) []string {
}
// A regular expression for the Go toolchain version syntax.
var toolchainVersionRe *regexp.Regexp = regexp.MustCompile(`(?m)^([0-9]+\.[0-9]+\.[0-9]+)$`)
var toolchainVersionRe *regexp.Regexp = regexp.MustCompile(`(?m)^([0-9]+\.[0-9]+(\.[0-9]+|rc[0-9]+))$`)
// Returns true if the `go.mod` file specifies a Go language version, that version is `1.21` or greater, and
// there is no `toolchain` directive, and the Go language version is not a valid toolchain version.