Merge pull request #33 from adamdecaf/watcher-break
watcher: properly break out in nested blocks
commit787d3da9d208a4cc6e1dbadc243a083269e121b3
authorJoel Speed <Joel.speed@hotmail.co.uk>
dateThu 31 Jan 2019, 09:54 (8 years ago)
parent090ff116a775b9
watcher.go+1−1
@@ -45,7 +45,7 @@ func WatchForUpdates(filename string, done <-chan bool, action func()) {
4545 select {
4646 case _ = <-done:
4747 log.Printf("Shutting down watcher for: %s", filename)
48− break
48+ return
4949 case event := <-watcher.Events:
5050 // On Arch Linux, it appears Chmod events precede Remove events,
5151 // which causes a race between action() and the coming Remove event.