This commit is contained in:
Alex Yatskov 2015-11-01 18:43:28 +09:00
parent ae5f777689
commit 2a32c99767
2 changed files with 4 additions and 4 deletions

View File

@ -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
}
}

View File

@ -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
}