Skip to content

Commit 01a1d81

Browse files
committed
Do not call EmitNewerGoVersionNeeded for v1.21+
1 parent c63f680 commit 01a1d81

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

go/extractor/cli/go-autobuilder/go-autobuilder.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,9 @@ func installDependenciesAndBuild() {
788788

789789
goVersionInfo := tryReadGoDirective(buildInfo)
790790

791-
if goVersionInfo.Found && semver.Compare("v"+goVersionInfo.Version, getEnvGoSemVer()) > 0 {
791+
// This diagnostic is not required if the system Go version is 1.21 or greater, since the
792+
// Go tooling should install required Go versions as needed.
793+
if semver.Compare(getEnvGoSemVer(), "v1.21.0") < 0 && goVersionInfo.Found && semver.Compare("v"+goVersionInfo.Version, getEnvGoSemVer()) > 0 {
792794
diagnostics.EmitNewerGoVersionNeeded()
793795
}
794796

0 commit comments

Comments
 (0)