diff --git a/watcher.go b/watcher.go index 28cd4c2..0ba4234 100644 --- a/watcher.go +++ b/watcher.go @@ -45,7 +45,7 @@ func WatchForUpdates(filename string, done <-chan bool, action func()) { select { case _ = <-done: log.Printf("Shutting down watcher for: %s", filename) - break + return case event := <-watcher.Events: // On Arch Linux, it appears Chmod events precede Remove events, // which causes a race between action() and the coming Remove event.