mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Fix bug detecting if go.mod files are nested
This commit is contained in:
@@ -249,8 +249,16 @@ func getDirs(paths []string) []string {
|
||||
return dirs
|
||||
}
|
||||
|
||||
// Note this has the side effect of sorting `dirs`
|
||||
func checkDirsNested(dirs []string) bool {
|
||||
func checkDirsNested(inputDirs []string) bool {
|
||||
// replace "." with "" so that we can check if all the paths are nested
|
||||
dirs := make([]string, len(inputDirs))
|
||||
for i, inputDir := range inputDirs {
|
||||
if inputDir == "." {
|
||||
dirs[i] = ""
|
||||
} else {
|
||||
dirs[i] = inputDir
|
||||
}
|
||||
}
|
||||
// the paths were generated by a depth-first search so I think they might
|
||||
// be sorted, but we sort them just in case
|
||||
sort.Strings(dirs)
|
||||
|
||||
Reference in New Issue
Block a user