From 30ea7a4ec4d3ddf22826461dc0875848ecf82f2d Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Tue, 28 Jan 2025 00:02:21 +0100 Subject: [PATCH] chore: update to use WalkDir --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index a1fae36..e397813 100644 --- a/main.go +++ b/main.go @@ -30,7 +30,7 @@ func main() { switch flag.Arg(0) { case "normalize": - err := filepath.Walk(*path, normalize) + err := filepath.WalkDir(*path, normalize) if err != nil { panic(err) } @@ -91,10 +91,11 @@ func removeSuffix(suffix string) filepath.WalkFunc { } } -func normalize(p string, f os.FileInfo, err error) error { +func normalize(p string, f os.DirEntry, err error) error { if f == nil { return nil } + filename := f.Name() if skip, err := skipDir(filename); skip { return err