Skip to content

Commit

Permalink
fix: do not override pattern
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Nov 8, 2020
1 parent 74616f9 commit 1d2f0f3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions glob.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@ func QuoteMeta(pattern string) string {
}

// Glob returns all files that match the given pattern in the current directory.
func Glob(pattern string, opts ...OptFunc) ([]string, error) { // nolint:funlen
var options = compileOptions(opts)
pattern = strings.TrimPrefix(pattern, "./")
func Glob(pattern string, opts ...OptFunc) ([]string, error) {
return doGlob(
strings.TrimPrefix(pattern, "./"),
compileOptions(opts),
)
}

func doGlob(pattern string, options *globOptions) ([]string, error) { // nolint:funlen
var fs = options.fs
var matches []string

Expand Down

0 comments on commit 1d2f0f3

Please sign in to comment.