Skip to content

Commit

Permalink
Merge pull request #14234 from github/mbg/go/1.21-update-version-regex
Browse files Browse the repository at this point in the history
Go: Update `versionRe` to include patch version
  • Loading branch information
mbg authored Sep 15, 2023
2 parents 264e57f + d7278be commit 8dd7602
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/extractor/cli/go-autobuilder/go-autobuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func getDepMode(emitDiagnostics bool) (DependencyInstallerMode, string) {
// Tries to open `go.mod` and read a go directive, returning the version and whether it was found.
func tryReadGoDirective(buildInfo BuildInfo) (string, bool) {
if buildInfo.DepMode == GoGetWithModules {
versionRe := regexp.MustCompile(`(?m)^go[ \t\r]+([0-9]+\.[0-9]+)$`)
versionRe := regexp.MustCompile(`(?m)^go[ \t\r]+([0-9]+\.[0-9]+(\.[0-9]+)?)$`)
goMod, err := os.ReadFile(filepath.Join(buildInfo.BaseDir, "go.mod"))
if err != nil {
log.Println("Failed to read go.mod to check for missing Go version")
Expand Down

0 comments on commit 8dd7602

Please sign in to comment.