diff options
| author | Russ Cox <rsc@golang.org> | 2014-10-03 12:22:19 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2014-10-03 12:22:19 -0400 |
| commit | 904ec0098137f742e0dd96da3bc033d6a0b615d1 (patch) | |
| tree | 6a05a91443927524fcb78ac82df0142d8e6ae71f /src/path/filepath/match.go | |
| parent | d42328c9f749140adf947833e0381fc639c32737 (diff) | |
| parent | c65a47f890e33eeed6ee9d8b6d965a5534fb6e0e (diff) | |
| download | go-904ec0098137f742e0dd96da3bc033d6a0b615d1.tar.xz | |
[dev.garbage] merge default into dev.garbage
Diffstat (limited to 'src/path/filepath/match.go')
| -rw-r--r-- | src/path/filepath/match.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/path/filepath/match.go b/src/path/filepath/match.go index a9bcc103c5..ecc07aa5da 100644 --- a/src/path/filepath/match.go +++ b/src/path/filepath/match.go @@ -228,6 +228,9 @@ 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.Lstat(pattern); err != 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 { |
