File tree Expand file tree Collapse file tree 3 files changed +10
-17
lines changed Expand file tree Collapse file tree 3 files changed +10
-17
lines changed Original file line number Diff line number Diff line change 7
7
"strings"
8
8
9
9
"github.com/hmarr/codeowners"
10
- "github.com/karrick/godirwalk"
11
10
flag "github.com/spf13/pflag"
12
11
)
13
12
@@ -60,19 +59,16 @@ func main() {
60
59
continue
61
60
}
62
61
63
- err = godirwalk .Walk (startPath , & godirwalk.Options {
64
- Callback : func (path string , dirent * godirwalk.Dirent ) error {
65
- if path == ".git" {
66
- return filepath .SkipDir
67
- }
68
-
69
- // Only show code owners for files, not directories
70
- if ! dirent .IsDir () {
71
- return printFileOwners (ruleset , path , ownerFilters , showUnowned )
72
- }
73
- return nil
74
- },
75
- Unsorted : true ,
62
+ err = filepath .WalkDir (startPath , func (path string , d os.DirEntry , err error ) error {
63
+ if path == ".git" {
64
+ return filepath .SkipDir
65
+ }
66
+
67
+ // Only show code owners for files, not directories
68
+ if ! d .IsDir () {
69
+ return printFileOwners (ruleset , path , ownerFilters , showUnowned )
70
+ }
71
+ return nil
76
72
})
77
73
78
74
if err != nil {
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ module github.com/hmarr/codeowners
3
3
go 1.14
4
4
5
5
require (
6
- github.com/karrick/godirwalk v1.17.0
7
6
github.com/spf13/pflag v1.0.5
8
7
github.com/stretchr/testify v1.8.0
9
8
)
Original file line number Diff line number Diff line change 1
1
github.com/davecgh/go-spew v1.1.0 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
2
2
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c =
3
3
github.com/davecgh/go-spew v1.1.1 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
4
- github.com/karrick/godirwalk v1.17.0 h1:b4kY7nqDdioR/6qnbHQyDvmA17u5G1cZ6J+CZXwSWoI =
5
- github.com/karrick/godirwalk v1.17.0 /go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk =
6
4
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
7
5
github.com/pmezard/go-difflib v1.0.0 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
8
6
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA =
You can’t perform that action at this time.
0 commit comments