From cff5f0357ea35245ac906a0326863ac1f8c47c61 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Sat, 29 Mar 2014 22:12:43 -0700 Subject: [PATCH] Minor cleanup Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes (github: creack) --- api/client/commands.go | 14 +++++++++----- server/server.go | 8 +++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/api/client/commands.go b/api/client/commands.go index 49cd07700f..01fc9a9106 100644 --- a/api/client/commands.go +++ b/api/client/commands.go @@ -549,9 +549,11 @@ func (cli *DockerCli) forwardAllSignals(cid string) chan os.Signal { } func (cli *DockerCli) CmdStart(args ...string) error { - cmd := cli.Subcmd("start", "CONTAINER [CONTAINER...]", "Restart a stopped container") - attach := cmd.Bool([]string{"a", "-attach"}, false, "Attach container's stdout/stderr and forward all signals to the process") - openStdin := cmd.Bool([]string{"i", "-interactive"}, false, "Attach container's stdin") + var ( + cmd = cli.Subcmd("start", "CONTAINER [CONTAINER...]", "Restart a stopped container") + attach = cmd.Bool([]string{"a", "-attach"}, false, "Attach container's stdout/stderr and forward all signals to the process") + openStdin = cmd.Bool([]string{"i", "-interactive"}, false, "Attach container's stdin") + ) if err := cmd.Parse(args); err != nil { return nil } @@ -560,8 +562,10 @@ func (cli *DockerCli) CmdStart(args ...string) error { return nil } - var cErr chan error - var tty bool + var ( + cErr chan error + tty bool + ) if *attach || *openStdin { if cmd.NArg() > 1 { return fmt.Errorf("You cannot start and attach multiple containers at once.") diff --git a/server/server.go b/server/server.go index 2cb3328d55..af9976b4e2 100644 --- a/server/server.go +++ b/server/server.go @@ -2064,9 +2064,11 @@ func (srv *Server) ContainerStart(job *engine.Job) engine.Status { if len(job.Args) < 1 { return job.Errorf("Usage: %s container_id", job.Name) } - name := job.Args[0] - runtime := srv.runtime - container := runtime.Get(name) + var ( + name = job.Args[0] + runtime = srv.runtime + container = runtime.Get(name) + ) if container == nil { return job.Errorf("No such container: %s", name)