Skip to content

Commit

Permalink
fixed removing parent path when encountering an error
Browse files Browse the repository at this point in the history
  • Loading branch information
Le-G committed Jan 14, 2019
1 parent 3818ec2 commit 593985f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ func (w *Watcher) retrieveFileList() map[string]os.FileInfo {
if os.IsNotExist(err) {
w.Error <- ErrWatchedFileDeleted
w.mu.Unlock()
w.RemoveRecursive(name)
w.RemoveRecursive(err.(*os.PathError).Path)
w.mu.Lock()
} else {
w.Error <- err
Expand All @@ -509,7 +509,7 @@ func (w *Watcher) retrieveFileList() map[string]os.FileInfo {
if os.IsNotExist(err) {
w.Error <- ErrWatchedFileDeleted
w.mu.Unlock()
w.Remove(name)
w.Remove(err.(*os.PathError).Path)
w.mu.Lock()
} else {
w.Error <- err
Expand Down

0 comments on commit 593985f

Please sign in to comment.