Skip to content

Commit 925e99c

Browse files
committed
Go: Use GoFilesOutsideDirs to find stray source files
1 parent f0df7cd commit 925e99c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

go/extractor/project/project.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ func getBuildRoots(emitDiagnostics bool) (goWorkspaces []GoWorkspace, totalModul
368368
}
369369

370370
goModDirs := util.GetParentDirs(goModPaths)
371-
if util.AnyGoFilesOutsideDirs(".", goModDirs...) {
371+
straySourceFiles := util.GoFilesOutsideDirs(".", goModDirs...)
372+
if len(straySourceFiles) > 0 {
372373
if emitDiagnostics {
373374
diagnostics.EmitGoFilesOutsideGoModules(goModPaths)
374375
}

0 commit comments

Comments
 (0)