From 6a775b97c97c4a51875f3098b9a6121e19393219 Mon Sep 17 00:00:00 2001 From: Adam Shannon Date: Wed, 30 Jan 2019 18:54:27 -0600 Subject: [PATCH] watcher: properly break out in nested blocks Found via staticcheck: watcher.go:48:5: ineffective break statement. Did you mean to break out of the outer loop? (SA4011) --- watcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.