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 77 "strings"
88
99 "github.com/hmarr/codeowners"
10- "github.com/karrick/godirwalk"
1110 flag "github.com/spf13/pflag"
1211)
1312
@@ -60,19 +59,16 @@ func main() {
6059 continue
6160 }
6261
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
7672 })
7773
7874 if err != nil {
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ module github.com/hmarr/codeowners
33go 1.14
44
55require (
6- github.com/karrick/godirwalk v1.17.0
76 github.com/spf13/pflag v1.0.5
87 github.com/stretchr/testify v1.8.0
98)
Original file line number Diff line number Diff line change 11github.com/davecgh/go-spew v1.1.0 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
22github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c =
33github.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 =
64github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM =
75github.com/pmezard/go-difflib v1.0.0 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
86github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA =
You can’t perform that action at this time.
0 commit comments