Skip to content

Commit 7aad6fd

Browse files
bobsingh-devAxel von Bertoldi
authored andcommitted
Fix: guard against nil FileInfo in filepath.Walk
1 parent 9452f0f commit 7aad6fd

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • scripts/check-test-directives

scripts/check-test-directives/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,13 @@ func walkTestFiles(testType string, rootPath string, walkFunc filepath.WalkFunc)
105105
fmt.Printf("\nChecking %s test files...\n", testType)
106106

107107
err := filepath.Walk(rootPath, func(path string, info fs.FileInfo, err error) error {
108+
if err != nil {
109+
recordError(path, err)
110+
return nil
111+
}
112+
108113
name := info.Name()
114+
109115
if info.IsDir() && lo.Contains(ignoreDirectories, name) {
110116
return filepath.SkipDir
111117
}

0 commit comments

Comments
 (0)