Merge pull request #1484 from titanous/use-range
Use ranged for loop on channels
This commit is contained in:
commit
3e12349831
3
api.go
3
api.go
|
@ -236,8 +236,7 @@ func getEvents(srv *Server, version float64, w http.ResponseWriter, r *http.Requ
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for {
|
for event := range listener {
|
||||||
event := <-listener
|
|
||||||
err := sendEvent(wf, &event)
|
err := sendEvent(wf, &event)
|
||||||
if err != nil && err.Error() == "JSON error" {
|
if err != nil && err.Error() == "JSON error" {
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -1728,8 +1728,7 @@ func (cli *DockerCli) monitorTtySize(id string) error {
|
||||||
sigchan := make(chan os.Signal, 1)
|
sigchan := make(chan os.Signal, 1)
|
||||||
signal.Notify(sigchan, syscall.SIGWINCH)
|
signal.Notify(sigchan, syscall.SIGWINCH)
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for _ = range sigchan {
|
||||||
<-sigchan
|
|
||||||
cli.resizeTty(id)
|
cli.resizeTty(id)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
Loading…
Reference in New Issue