From e2d034e48858d0afe9ee0f88f04e40cbf95ab8ba Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Tue, 18 Jun 2013 10:06:26 -0700 Subject: [PATCH] Remove useless goroutine --- commands.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/commands.go b/commands.go index 847b5d3b33..0703f4ebe0 100644 --- a/commands.go +++ b/commands.go @@ -1270,7 +1270,6 @@ func (cli *DockerCli) CmdRun(args ...string) error { if !config.AttachStdout && !config.AttachStderr { fmt.Println(out.ID) } else { - chErrors := make(chan error) if config.Tty { cli.monitorTtySize(out.ID) } @@ -1288,10 +1287,7 @@ func (cli *DockerCli) CmdRun(args ...string) error { if config.AttachStderr { v.Set("stderr", "1") } - go func() { - chErrors <- cli.hijack("POST", "/containers/"+out.ID+"/attach?"+v.Encode(), config.Tty, os.Stdin, os.Stdout) - }() - if err := <-chErrors; err != nil { + if err := cli.hijack("POST", "/containers/"+out.ID+"/attach?"+v.Encode(), config.Tty, os.Stdin, os.Stdout); err != nil { utils.Debugf("Error hijack: %s", err) return err }