Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle WalkDir errors #1696

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pkg/linter/linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func allPaths(fn func(ctx context.Context, pkgname, path string) error) func(ctx
if err := ctx.Err(); err != nil {
return err
}
if err != nil {
return err
}
if d.IsDir() {
// Ignore directories
return nil
Expand Down Expand Up @@ -286,7 +289,6 @@ func worldWriteableLinter(ctx context.Context, pkgname string, fsys fs.FS) error
if err := ctx.Err(); err != nil {
return err
}

if err != nil {
return err
}
Expand Down Expand Up @@ -389,9 +391,12 @@ func strippedLinter(ctx context.Context, _ string, fsys fs.FS) error {
})
}

func emptyLinter(_ context.Context, pkgname string, fsys fs.FS) error {
func emptyLinter(ctx context.Context, pkgname string, fsys fs.FS) error {
foundfile := false
err := fs.WalkDir(fsys, ".", func(path string, d fs.DirEntry, err error) error {
if err := ctx.Err(); err != nil {
return err
}
if err != nil {
return err
}
Expand Down
Loading