diff --git a/goldsmith.go b/goldsmith.go index affc69b..c68870f 100644 --- a/goldsmith.go +++ b/goldsmith.go @@ -100,7 +100,7 @@ func (gs *goldsmith) chainSingle(s stage, cs ChainerSingle, globs []string) { matched := true if len(globs) > 0 { var err error - if matched, err = globMatch(file.Path, globs); err != nil { + if matched, err = globMatch(globs, file.Path); err != nil { file.Err = err } } @@ -126,7 +126,7 @@ func (gs *goldsmith) chainMultiple(s stage, cm ChainerMultiple, globs []string) matched := true if len(globs) > 0 { var err error - if matched, err = globMatch(file.Path, globs); err != nil { + if matched, err = globMatch(globs, file.Path); err != nil { file.Err = err } } diff --git a/util.go b/util.go index 55a532f..de46f40 100644 --- a/util.go +++ b/util.go @@ -24,14 +24,14 @@ package goldsmith import "path/filepath" -func globMatch(pattern string, globs []string) (bool, error) { +func globMatch(globs []string, name string) (bool, error) { var ( match bool err error ) for _, glob := range globs { - match, err = filepath.Match(pattern, glob) + match, err = filepath.Match(glob, name) if err != nil || match { break }