Fix error handling in SymbolicWalk

This commit is contained in:
Bjørn Erik Pedersen 2016-03-25 18:18:39 +01:00
parent bfe8009415
commit dbfc7ea024

View file

@ -453,14 +453,14 @@ func SymbolicWalk(fs afero.Fs, root string, walker filepath.WalkFunc) error {
// Handle the root first // Handle the root first
fileInfo, err := lstatIfOs(fs, root) fileInfo, err := lstatIfOs(fs, root)
if err != nil || !fileInfo.IsDir() {
return nil
}
if err != nil { if err != nil {
return walker(root, nil, err) return walker(root, nil, err)
} }
if !fileInfo.IsDir() {
return nil
}
if err := walker(root, fileInfo, err); err != nil && err != filepath.SkipDir { if err := walker(root, fileInfo, err); err != nil && err != filepath.SkipDir {
return err return err
} }