From b6fe99530cc885e9841f4ded90b409581886bbd4 Mon Sep 17 00:00:00 2001 From: yuexiao-wang Date: Thu, 10 Nov 2016 10:39:23 +0800 Subject: [PATCH] Remove redundant parameter and fix typos Signed-off-by: yuexiao-wang --- command/container/exec.go | 5 ++--- command/container/exec_test.go | 7 +++---- command/stack/list.go | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/command/container/exec.go b/command/container/exec.go index 84eba113cf..4bc8c58066 100644 --- a/command/container/exec.go +++ b/command/container/exec.go @@ -65,7 +65,7 @@ func NewExecCommand(dockerCli *command.DockerCli) *cobra.Command { } func runExec(dockerCli *command.DockerCli, opts *execOptions, container string, execCmd []string) error { - execConfig, err := parseExec(opts, container, execCmd) + execConfig, err := parseExec(opts, execCmd) // just in case the ParseExec does not exit if container == "" || err != nil { return cli.StatusError{StatusCode: 1} @@ -181,14 +181,13 @@ func getExecExitCode(ctx context.Context, client apiclient.ContainerAPIClient, e // parseExec parses the specified args for the specified command and generates // an ExecConfig from it. -func parseExec(opts *execOptions, container string, execCmd []string) (*types.ExecConfig, error) { +func parseExec(opts *execOptions, execCmd []string) (*types.ExecConfig, error) { execConfig := &types.ExecConfig{ User: opts.user, Privileged: opts.privileged, Tty: opts.tty, Cmd: execCmd, Detach: opts.detach, - // container is not used here } // If -d is not set, attach to everything by default diff --git a/command/container/exec_test.go b/command/container/exec_test.go index 2e122e7386..baeeaf1904 100644 --- a/command/container/exec_test.go +++ b/command/container/exec_test.go @@ -7,9 +7,8 @@ import ( ) type arguments struct { - options execOptions - container string - execCmd []string + options execOptions + execCmd []string } func TestParseExec(t *testing.T) { @@ -73,7 +72,7 @@ func TestParseExec(t *testing.T) { } for valid, expectedExecConfig := range valids { - execConfig, err := parseExec(&valid.options, valid.container, valid.execCmd) + execConfig, err := parseExec(&valid.options, valid.execCmd) if err != nil { t.Fatal(err) } diff --git a/command/stack/list.go b/command/stack/list.go index f655b929ad..7be42525dd 100644 --- a/command/stack/list.go +++ b/command/stack/list.go @@ -72,7 +72,7 @@ func printTable(out io.Writer, stacks []*stack) { type stack struct { // Name is the name of the stack - Name string + Name string // Services is the number of the services Services int }