Minor cleanups in cli/command/container

This change does some minor cleanups in the
cli/command/container package;

- sort imports
- replace `fmt.Fprintf()` with `fmt.Fprintln()` if no formatting is used
- replace `fmt.Errorf()` with `errors.New()` if no formatting is used
- remove some redundant `else`'s

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2016-12-25 01:05:37 +01:00
parent 2825296deb
commit f459796896
27 changed files with 109 additions and 122 deletions

View File

@ -4,8 +4,6 @@ import (
"fmt"
"io"
"golang.org/x/net/context"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api/types"
"github.com/docker/docker/cli"
@ -15,6 +13,7 @@ import (
"github.com/docker/docker/pkg/promise"
runconfigopts "github.com/docker/docker/runconfig/opts"
"github.com/spf13/cobra"
"golang.org/x/net/context"
)
type execOptions struct {
@ -88,7 +87,7 @@ func runExec(dockerCli *command.DockerCli, opts *execOptions, container string,
execID := response.ID
if execID == "" {
fmt.Fprintf(dockerCli.Out(), "exec ID empty")
fmt.Fprintln(dockerCli.Out(), "exec ID empty")
return nil
}
@ -143,7 +142,7 @@ func runExec(dockerCli *command.DockerCli, opts *execOptions, container string,
if execConfig.Tty && dockerCli.In().IsTerminal() {
if err := MonitorTtySize(ctx, dockerCli, execID, true); err != nil {
fmt.Fprintf(dockerCli.Err(), "Error monitoring TTY size: %s\n", err)
fmt.Fprintln(dockerCli.Err(), "Error monitoring TTY size:", err)
}
}