Go autobuilder: don't attempt a go mod tidy when there's a vendor directory present

This is likely to spuriously remove dependencies leading to a later build failure due to missing requirements.
This commit is contained in:
Chris Smowton
2022-06-16 10:12:39 +01:00
parent cdf343c5ee
commit 16a2107f89

View File

@@ -291,7 +291,7 @@ func main() {
}
// Go 1.16 and later won't automatically attempt to update go.mod / go.sum during package loading, so try to update them here:
if depMode == GoGetWithModules && semver.Compare(getEnvGoSemVer(), "1.16") >= 0 {
if modMode != ModVendor && depMode == GoGetWithModules && semver.Compare(getEnvGoSemVer(), "1.16") >= 0 {
// stat go.mod and go.sum
beforeGoModFileInfo, beforeGoModErr := os.Stat("go.mod")
if beforeGoModErr != nil {