diff --git a/api.go b/api.go index 9349065437..c9ac15bc53 100644 --- a/api.go +++ b/api.go @@ -236,8 +236,7 @@ func getEvents(srv *Server, version float64, w http.ResponseWriter, r *http.Requ } } } - for { - event := <-listener + for event := range listener { err := sendEvent(wf, &event) if err != nil && err.Error() == "JSON error" { continue diff --git a/commands.go b/commands.go index d4aafba7b3..c9f669b782 100644 --- a/commands.go +++ b/commands.go @@ -1728,8 +1728,7 @@ func (cli *DockerCli) monitorTtySize(id string) error { sigchan := make(chan os.Signal, 1) signal.Notify(sigchan, syscall.SIGWINCH) go func() { - for { - <-sigchan + for _ = range sigchan { cli.resizeTty(id) } }()