From 690ef8af798b44947362b30c339ad0664adb13bd Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Tue, 2 May 2017 15:35:25 -0400 Subject: [PATCH] Enable golint Signed-off-by: Daniel Nephin --- cli/command/container/export.go | 2 +- cli/command/container/start.go | 4 ++-- cli/command/container/update.go | 2 +- cli/command/image/save.go | 2 +- cli/command/node/ps.go | 2 +- cli/command/service/ps.go | 2 +- cli/command/stack/deploy.go | 2 +- cli/command/stack/ps.go | 2 +- cli/command/task/print.go | 2 +- gometalinter.json | 4 ++-- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cli/command/container/export.go b/cli/command/container/export.go index 4b2c293a6c..700f557624 100644 --- a/cli/command/container/export.go +++ b/cli/command/container/export.go @@ -38,7 +38,7 @@ func NewExportCommand(dockerCli *command.DockerCli) *cobra.Command { func runExport(dockerCli *command.DockerCli, opts exportOptions) error { if opts.output == "" && dockerCli.Out().IsTerminal() { - return errors.New("Cowardly refusing to save to a terminal. Use the -o flag or redirect.") + return errors.New("cowardly refusing to save to a terminal. Use the -o flag or redirect") } clnt := dockerCli.Client() diff --git a/cli/command/container/start.go b/cli/command/container/start.go index e6e5b595b1..08d8023f55 100644 --- a/cli/command/container/start.go +++ b/cli/command/container/start.go @@ -59,7 +59,7 @@ func runStart(dockerCli *command.DockerCli, opts *startOptions) error { // We're going to attach to a container. // 1. Ensure we only have one container. if len(opts.containers) > 1 { - return errors.New("You cannot start and attach multiple containers at once.") + return errors.New("you cannot start and attach multiple containers at once") } // 2. Attach to the container. @@ -143,7 +143,7 @@ func runStart(dockerCli *command.DockerCli, opts *startOptions) error { } } else if opts.checkpoint != "" { if len(opts.containers) > 1 { - return errors.New("You cannot restore multiple containers at once.") + return errors.New("you cannot restore multiple containers at once") } container := opts.containers[0] startOptions := types.ContainerStartOptions{ diff --git a/cli/command/container/update.go b/cli/command/container/update.go index dd452dc01e..3743ad5c59 100644 --- a/cli/command/container/update.go +++ b/cli/command/container/update.go @@ -77,7 +77,7 @@ func runUpdate(dockerCli *command.DockerCli, opts *updateOptions) error { var err error if opts.nFlag == 0 { - return errors.New("You must provide one or more flags when using this command.") + return errors.New("you must provide one or more flags when using this command") } var restartPolicy containertypes.RestartPolicy diff --git a/cli/command/image/save.go b/cli/command/image/save.go index 37325edead..cb049d5eaf 100644 --- a/cli/command/image/save.go +++ b/cli/command/image/save.go @@ -38,7 +38,7 @@ func NewSaveCommand(dockerCli *command.DockerCli) *cobra.Command { func runSave(dockerCli *command.DockerCli, opts saveOptions) error { if opts.output == "" && dockerCli.Out().IsTerminal() { - return errors.New("Cowardly refusing to save to a terminal. Use the -o flag or redirect.") + return errors.New("cowardly refusing to save to a terminal. Use the -o flag or redirect") } responseBody, err := dockerCli.Client().ImageSave(context.Background(), opts.images) diff --git a/cli/command/node/ps.go b/cli/command/node/ps.go index 0e1aa6bd41..37346ce862 100644 --- a/cli/command/node/ps.go +++ b/cli/command/node/ps.go @@ -96,7 +96,7 @@ func runPs(dockerCli command.Cli, opts psOptions) error { } if len(errs) == 0 || len(tasks) != 0 { - if err := task.Print(dockerCli, ctx, tasks, idresolver.New(client, opts.noResolve), !opts.noTrunc, opts.quiet, format); err != nil { + if err := task.Print(ctx, dockerCli, tasks, idresolver.New(client, opts.noResolve), !opts.noTrunc, opts.quiet, format); err != nil { errs = append(errs, err.Error()) } } diff --git a/cli/command/service/ps.go b/cli/command/service/ps.go index 51a00638bc..624873815a 100644 --- a/cli/command/service/ps.go +++ b/cli/command/service/ps.go @@ -119,5 +119,5 @@ func runPS(dockerCli *command.DockerCli, opts psOptions) error { } } - return task.Print(dockerCli, ctx, tasks, idresolver.New(client, opts.noResolve), !opts.noTrunc, opts.quiet, format) + return task.Print(ctx, dockerCli, tasks, idresolver.New(client, opts.noResolve), !opts.noTrunc, opts.quiet, format) } diff --git a/cli/command/stack/deploy.go b/cli/command/stack/deploy.go index 1bef0e7f4a..5817e35c51 100644 --- a/cli/command/stack/deploy.go +++ b/cli/command/stack/deploy.go @@ -72,7 +72,7 @@ func checkDaemonIsSwarmManager(ctx context.Context, dockerCli *command.DockerCli return err } if !info.Swarm.ControlAvailable { - return errors.New("This node is not a swarm manager. Use \"docker swarm init\" or \"docker swarm join\" to connect this node to swarm and try again.") + return errors.New("this node is not a swarm manager. Use \"docker swarm init\" or \"docker swarm join\" to connect this node to swarm and try again") } return nil } diff --git a/cli/command/stack/ps.go b/cli/command/stack/ps.go index a09e7fa8a8..45df793e80 100644 --- a/cli/command/stack/ps.go +++ b/cli/command/stack/ps.go @@ -72,5 +72,5 @@ func runPS(dockerCli *command.DockerCli, opts psOptions) error { } } - return task.Print(dockerCli, ctx, tasks, idresolver.New(client, opts.noResolve), !opts.noTrunc, opts.quiet, format) + return task.Print(ctx, dockerCli, tasks, idresolver.New(client, opts.noResolve), !opts.noTrunc, opts.quiet, format) } diff --git a/cli/command/task/print.go b/cli/command/task/print.go index 5b96854ffe..658c0e5510 100644 --- a/cli/command/task/print.go +++ b/cli/command/task/print.go @@ -35,7 +35,7 @@ func (t tasksBySlot) Less(i, j int) bool { // Print task information in a format. // Besides this, command `docker node ps ` // and `docker stack ps` will call this, too. -func Print(dockerCli command.Cli, ctx context.Context, tasks []swarm.Task, resolver *idresolver.IDResolver, trunc, quiet bool, format string) error { +func Print(ctx context.Context, dockerCli command.Cli, tasks []swarm.Task, resolver *idresolver.IDResolver, trunc, quiet bool, format string) error { sort.Stable(tasksBySlot(tasks)) names := map[string]string{} diff --git a/gometalinter.json b/gometalinter.json index f3aa2725cb..4e10e547f5 100644 --- a/gometalinter.json +++ b/gometalinter.json @@ -1,8 +1,8 @@ { "Vendor": true, - "Sort": ["linter", "severity"], + "Sort": ["linter", "severity", "path"], "Exclude": ["cli/compose/schema/bindata.go"], "DisableAll": true, - "Enable": ["gofmt", "vet"] + "Enable": ["gofmt", "vet", "golint"] }