From 2a32c99767f4ea596e3eeba544780e7720260e4c Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 1 Nov 2015 18:43:28 +0900 Subject: [PATCH] Globbing --- goldsmith.go | 4 ++-- util.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 }