Skip to content

Commit a64c001

Browse files
committed
Go: Remove unnecessary call to Canonical
1 parent 42dcb5f commit a64c001

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,11 +795,10 @@ func installDependenciesAndBuild() {
795795
}
796796

797797
goVersionInfo := tryReadGoDirective(buildInfo)
798-
canonEnvSemVer := semver.Canonical(getEnvGoSemVer())
799798

800799
// This diagnostic is not required if the system Go version is 1.21 or greater, since the
801800
// Go tooling should install required Go versions as needed.
802-
if semver.Compare(canonEnvSemVer, "v1.21.0") < 0 && goVersionInfo.Found && semver.Compare("v"+goVersionInfo.Version, canonEnvSemVer) > 0 {
801+
if semver.Compare(getEnvGoSemVer(), "v1.21.0") < 0 && goVersionInfo.Found && semver.Compare("v"+goVersionInfo.Version, getEnvGoSemVer()) > 0 {
803802
diagnostics.EmitNewerGoVersionNeeded()
804803
}
805804

0 commit comments

Comments
 (0)