From 7b7162896ab6efcdebfd39413e008ba4f2453ea5 Mon Sep 17 00:00:00 2001 From: James Bayliss Date: Wed, 17 Feb 2021 18:04:05 +0000 Subject: [PATCH] triggers(inotify): handle err argument in walk func resolves #92 --- triggers/inotify/inotify.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/triggers/inotify/inotify.go b/triggers/inotify/inotify.go index b1cd751b..740a079d 100644 --- a/triggers/inotify/inotify.go +++ b/triggers/inotify/inotify.go @@ -109,6 +109,11 @@ func (d *daemon) startMonitoring() error { } func (d *daemon) walkFunc(path string, fi os.FileInfo, err error) error { + // handle error + if err != nil { + return fmt.Errorf("walk func: %v: %w", path, err) + } + // ignore non-directory if !fi.Mode().IsDir() { return nil