diff --git a/api.go b/api.go index 95b9c98de8..81d1e3aab1 100644 --- a/api.go +++ b/api.go @@ -223,8 +223,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 a2099b9607..42fb8cdc48 100644 --- a/commands.go +++ b/commands.go @@ -1696,8 +1696,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) } }()