Skip to content

Commit

Permalink
Use os.PathSeparator instead of /
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Lopez <[email protected]>
  • Loading branch information
marclop committed Jul 20, 2018
1 parent e52a042 commit 8ebd69a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func walk(p, ext string, exclude []string, dry bool, out io.Writer) error {

var currentPath = cleanPathPrefixes(
strings.Replace(path, p, "", 1),
[]string{"/"},
[]string{string(os.PathSeparator)},
)

var excludedDir = info.IsDir() && stringInSlice(info.Name(), defaultExludedDirs)
Expand Down
7 changes: 5 additions & 2 deletions path.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@

package main

import "strings"
import (
"os"
"strings"
)

func needsExclusion(path string, exclude []string) bool {
for _, excluded := range exclude {
excluded = cleanPathSuffixes(excluded, []string{"*", "/"})
excluded = cleanPathSuffixes(excluded, []string{"*", string(os.PathSeparator)})
if strings.HasPrefix(path, excluded) {
return true
}
Expand Down

0 comments on commit 8ebd69a

Please sign in to comment.