Skip to content

Commit 1afe845

Browse files
committed
Add missing "v" to semver version string
Because it was missing, that function always returned +1, so we were doing the wrong thing when the Go version installed was lower than 1.16.
1 parent bfe5db2 commit 1afe845

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ func getNeedGopath(depMode DependencyInstallerMode, importpath string) bool {
318318

319319
func tryUpdateGoModAndGoSum(modMode ModMode, depMode DependencyInstallerMode) {
320320
// Go 1.16 and later won't automatically attempt to update go.mod / go.sum during package loading, so try to update them here:
321-
if modMode != ModVendor && depMode == GoGetWithModules && semver.Compare(getEnvGoSemVer(), "1.16") >= 0 {
321+
if modMode != ModVendor && depMode == GoGetWithModules && semver.Compare(getEnvGoSemVer(), "v1.16") >= 0 {
322322
// stat go.mod and go.sum
323323
beforeGoModFileInfo, beforeGoModErr := os.Stat("go.mod")
324324
if beforeGoModErr != nil {

0 commit comments

Comments
 (0)