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:
commit
3e12349831
2 changed files with 2 additions and 4 deletions
3
api.go
3
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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Reference in a new issue