Skip to content

Commit 5864bdc

Browse files
committed
Modify buildInfo inside function fixGoVendorIssues
1 parent 6c89c60 commit 5864bdc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ func getModMode(depMode DependencyInstallerMode, baseDir string) ModMode {
401401
}
402402

403403
// fixGoVendorIssues fixes issues with go vendor for go version >= 1.14
404-
func fixGoVendorIssues(buildInfo BuildInfo, goModVersionFound bool) ModMode {
404+
func fixGoVendorIssues(buildInfo *BuildInfo, goModVersionFound bool) {
405405
if buildInfo.ModMode == ModVendor {
406406
// fix go vendor issues with go versions >= 1.14 when no go version is specified in the go.mod
407407
// if this is the case, and dependencies were vendored with an old go version (and therefore
@@ -421,13 +421,12 @@ func fixGoVendorIssues(buildInfo BuildInfo, goModVersionFound bool) ModMode {
421421
log.Println("Adding a version directive to the go.mod file as the modules.txt does not have explicit annotations")
422422
if !addVersionToMod("1.13") {
423423
log.Println("Failed to add a version to the go.mod file to fix explicitly required package bug; not using vendored dependencies")
424-
return ModMod
424+
buildInfo.ModMode = ModMod
425425
}
426426
}
427427
}
428428
}
429429
}
430-
return buildInfo.ModMode
431430
}
432431

433432
// Determines whether the project needs a GOPATH set up
@@ -778,7 +777,7 @@ func installDependenciesAndBuild() {
778777
diagnostics.EmitNewerGoVersionNeeded()
779778
}
780779

781-
buildInfo.ModMode = fixGoVendorIssues(buildInfo, goModVersionFound)
780+
fixGoVendorIssues(&buildInfo, goModVersionFound)
782781

783782
tryUpdateGoModAndGoSum(buildInfo)
784783

0 commit comments

Comments
 (0)