git.iko.soy/typeable/oauth2-proxy
on master help sign in
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)

commit6a775b97c97c4a51875f3098b9a6121e19393219 authorAdam Shannon <adamkshannon@gmail.com> dateWed 30 Jan 2019, 18:54 (8 years ago) parent090ff11
1 file changed+1−1
watcher.go+1−1
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.