Skip to content

Commit f6ad4cd

Browse files
Axel von BertoldiBob Singh
andcommitted
Merge branch 'fix/filepath-walk-nil-info' into 'main'
Fix: guard against nil FileInfo in filepath.Walk See merge request https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/6050 Merged-by: Axel von Bertoldi <avonbertoldi@gitlab.com> Approved-by: Timo Furrer <tfurrer@gitlab.com> Approved-by: Axel von Bertoldi <avonbertoldi@gitlab.com> Approved-by: Igor <iwiedler@gitlab.com> Reviewed-by: Axel von Bertoldi <avonbertoldi@gitlab.com> Co-authored-by: Bob Singh <bobsingh.dev@users.noreply.gitlab.com>
2 parents 9452f0f + 7aad6fd commit f6ad4cd

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)