Skip to content

Commit 24c7239

Browse files
committed
Go: Restore check for whether the version is >= 1.21 to begin with
1 parent 2f4157c commit 24c7239

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

go/extractor/project/project.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ func hasInvalidToolchainVersion(installedToolchainVersion util.SemVer, modFile *
208208
// does not match the toolchain version format in Go 1.21 and Go 1.22.
209209
// This is a problem if the installed Go toolchain is within that version range
210210
// as it will try to use the language version as the toolchain version.
211-
return installedToolchainVersion.IsAtLeast(toolchain.V1_21) && installedToolchainVersion.IsOlderThan(toolchain.V1_23)
211+
return util.NewSemVer(modFile.Go.Version).IsAtLeast(toolchain.V1_21) &&
212+
installedToolchainVersion.IsAtLeast(toolchain.V1_21) &&
213+
installedToolchainVersion.IsOlderThan(toolchain.V1_23)
212214
}
213215
return false
214216
}

0 commit comments

Comments
 (0)