diff options
Diffstat (limited to 'libgo/go/path/filepath/match.go')
-rw-r--r-- | libgo/go/path/filepath/match.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libgo/go/path/filepath/match.go b/libgo/go/path/filepath/match.go index 3d84145d7f..ecc07aa5da 100644 --- a/libgo/go/path/filepath/match.go +++ b/libgo/go/path/filepath/match.go @@ -228,9 +228,12 @@ func getEsc(chunk string) (r rune, nchunk string, err error) { // as in Match. The pattern may describe hierarchical names such as // /usr/*/bin/ed (assuming the Separator is '/'). // +// Glob ignores file system errors such as I/O errors reading directories. +// The only possible returned error is ErrBadPattern, when pattern +// is malformed. func Glob(pattern string) (matches []string, err error) { if !hasMeta(pattern) { - if _, err = os.Stat(pattern); err != nil { + if _, err = os.Lstat(pattern); err != nil { return nil, nil } return []string{pattern}, nil @@ -283,10 +286,7 @@ func glob(dir, pattern string, matches []string) (m []string, e error) { } defer d.Close() - names, err := d.Readdirnames(-1) - if err != nil { - return - } + names, _ := d.Readdirnames(-1) sort.Strings(names) for _, n := range names { |