Merge pull request #2094 from orisano/fix-unwrap-error

fix: unwrap error for os.IsNotExist
This commit is contained in:
David Ashpole 2018-11-07 12:28:27 -08:00 committed by GitHub
commit 13e3e833a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,7 @@ import (
"github.com/golang/glog"
"github.com/karrick/godirwalk"
"github.com/pkg/errors"
)
func DebugInfo(watches map[string][]string) map[string][]string {
@ -165,7 +166,7 @@ func listDirectories(dirpath string, parent string, recursive bool, output map[s
dirents, err := godirwalk.ReadDirents(dirpath, buf)
if err != nil {
// Ignore if this hierarchy does not exist.
if os.IsNotExist(err) {
if os.IsNotExist(errors.Cause(err)) {
err = nil
}
return err