1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #1484 from titanous/use-range

Use ranged for loop on channels
This commit is contained in:
Michael Crosby 2013-08-09 18:06:12 -07:00
commit 3e12349831
2 changed files with 2 additions and 4 deletions

3
api.go
View file

@ -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

View file

@ -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)
}
}()