@@ -270,13 +270,13 @@ func checkDirsNested(inputDirs []string) bool {
270
270
return true
271
271
}
272
272
273
- // Returns the directory to run the go build in and whether a go.mod file was
274
- // found .
275
- func findGoModFiles (emitDiagnostics bool ) (baseDir string , goModFound bool ) {
273
+ // Returns the directory to run the go build in and whether to use a go.mod
274
+ // file .
275
+ func findGoModFiles (emitDiagnostics bool ) (baseDir string , useGoMod bool ) {
276
276
goModPaths := util .FindAllFilesWithName ("." , "go.mod" , "vendor" )
277
277
if len (goModPaths ) == 0 {
278
278
baseDir = "."
279
- goModFound = false
279
+ useGoMod = false
280
280
return
281
281
}
282
282
goModDirs := getDirs (goModPaths )
@@ -285,7 +285,7 @@ func findGoModFiles(emitDiagnostics bool) (baseDir string, goModFound bool) {
285
285
diagnostics .EmitGoFilesOutsideGoModules (goModPaths )
286
286
}
287
287
baseDir = "."
288
- goModFound = false
288
+ useGoMod = false
289
289
return
290
290
}
291
291
if len (goModPaths ) > 1 {
@@ -298,7 +298,7 @@ func findGoModFiles(emitDiagnostics bool) (baseDir string, goModFound bool) {
298
298
}
299
299
}
300
300
baseDir = "."
301
- goModFound = false
301
+ useGoMod = false
302
302
return
303
303
}
304
304
if emitDiagnostics {
@@ -309,7 +309,7 @@ func findGoModFiles(emitDiagnostics bool) (baseDir string, goModFound bool) {
309
309
}
310
310
}
311
311
baseDir = goModDirs [0 ]
312
- goModFound = true
312
+ useGoMod = true
313
313
return
314
314
}
315
315
@@ -332,8 +332,8 @@ func getDepMode(emitDiagnostics bool) (DependencyInstallerMode, string) {
332
332
}
333
333
}
334
334
335
- baseDir , goModFound := findGoModFiles (emitDiagnostics )
336
- if goModFound {
335
+ baseDir , useGoMod := findGoModFiles (emitDiagnostics )
336
+ if useGoMod {
337
337
log .Println ("Found go.mod, enabling go modules" )
338
338
return GoGetWithModules , baseDir
339
339
}
0 commit comments