Skip to content

Commit

Permalink
ignore trailing slashes in excludes #20
Browse files Browse the repository at this point in the history
/path/to/exclude/ will be trimmed to /path/to/exclude while checking for excluded paths
  • Loading branch information
Martin Schlossarek authored and hillu committed Dec 16, 2021
1 parent 14a6d56 commit 6494052
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scanner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (flags *excludeFlags) String() string {
}

func (flags *excludeFlags) Set(value string) error {
*flags = append(*flags, value)
*flags = append(*flags, filepath.Clean(value))
return nil
}

Expand Down Expand Up @@ -131,7 +131,7 @@ func main() {
}

for _, root := range flag.Args() {
filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
filepath.Walk(filepath.Clean(root), func(path string, info os.FileInfo, err error) error {
if err != nil {
fmt.Fprintf(errFile, "%s: %s\n", path, err)
return nil
Expand Down

0 comments on commit 6494052

Please sign in to comment.