From 910d5d02473317c1021a14d1d37f4b2f4f9bc6c6 Mon Sep 17 00:00:00 2001 From: Alano Terblanche <18033717+Benehiko@users.noreply.github.com> Date: Tue, 2 Apr 2024 15:44:23 +0200 Subject: [PATCH] chore: remove backticks and resolve linting issues Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com> --- cli/command/builder/prune.go | 2 +- cli/command/container/prune.go | 2 +- cli/command/image/prune.go | 2 +- cli/command/network/prune.go | 2 +- cli/command/plugin/upgrade.go | 2 +- cli/command/system/prune.go | 2 +- cli/command/system/prune_test.go | 4 ++-- cli/command/trust/revoke.go | 2 +- cli/command/trust/revoke_test.go | 2 +- cli/command/utils.go | 2 +- cli/command/volume/prune.go | 2 +- cli/command/volume/prune_test.go | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cli/command/builder/prune.go b/cli/command/builder/prune.go index 890a5204fe..4b24957690 100644 --- a/cli/command/builder/prune.go +++ b/cli/command/builder/prune.go @@ -74,7 +74,7 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions) return 0, "", err } if !r { - return 0, "", errdefs.Cancelled(errors.New("`builder prune` has been cancelled")) + return 0, "", errdefs.Cancelled(errors.New("builder prune has been cancelled")) } } diff --git a/cli/command/container/prune.go b/cli/command/container/prune.go index 62518cfee1..1c879002a8 100644 --- a/cli/command/container/prune.go +++ b/cli/command/container/prune.go @@ -61,7 +61,7 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions) return 0, "", err } if !r { - return 0, "", errdefs.Cancelled(errors.New("`container prune` has been cancelled")) + return 0, "", errdefs.Cancelled(errors.New("container prune has been cancelled")) } } diff --git a/cli/command/image/prune.go b/cli/command/image/prune.go index 9d666c9b5b..7bdb24d8c5 100644 --- a/cli/command/image/prune.go +++ b/cli/command/image/prune.go @@ -75,7 +75,7 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions) return 0, "", err } if !r { - return 0, "", errdefs.Cancelled(errors.New("`image prune` has been cancelled")) + return 0, "", errdefs.Cancelled(errors.New("image prune has been cancelled")) } } diff --git a/cli/command/network/prune.go b/cli/command/network/prune.go index 09c3cf32ea..146f51559e 100644 --- a/cli/command/network/prune.go +++ b/cli/command/network/prune.go @@ -57,7 +57,7 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions) return "", err } if !r { - return "", errdefs.Cancelled(errors.New("`network prune` cancelled has been cancelled")) + return "", errdefs.Cancelled(errors.New("network prune cancelled has been cancelled")) } } diff --git a/cli/command/plugin/upgrade.go b/cli/command/plugin/upgrade.go index a3abff2116..d609c8d01e 100644 --- a/cli/command/plugin/upgrade.go +++ b/cli/command/plugin/upgrade.go @@ -69,7 +69,7 @@ func runUpgrade(ctx context.Context, dockerCli command.Cli, opts pluginOptions) return err } if !r { - return errdefs.Cancelled(errors.New("`plugin upgrade` has been cancelled")) + return errdefs.Cancelled(errors.New("plugin upgrade has been cancelled")) } } diff --git a/cli/command/system/prune.go b/cli/command/system/prune.go index 0c5dc8b50e..4861f14ca3 100644 --- a/cli/command/system/prune.go +++ b/cli/command/system/prune.go @@ -82,7 +82,7 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions) return err } if !r { - return errdefs.Cancelled(errors.New("`system prune` has been cancelled")) + return errdefs.Cancelled(errors.New("system prune has been cancelled")) } } pruneFuncs := []func(ctx context.Context, dockerCli command.Cli, all bool, filter opts.FilterOpt) (uint64, string, error){ diff --git a/cli/command/system/prune_test.go b/cli/command/system/prune_test.go index d895da8422..c2d5f7eeb1 100644 --- a/cli/command/system/prune_test.go +++ b/cli/command/system/prune_test.go @@ -17,7 +17,7 @@ func TestPrunePromptPre131DoesNotIncludeBuildCache(t *testing.T) { cli := test.NewFakeCli(&fakeClient{version: "1.30"}) cmd := newPruneCommand(cli) cmd.SetArgs([]string{}) - assert.ErrorContains(t, cmd.Execute(), "`system prune` has been cancelled") + assert.ErrorContains(t, cmd.Execute(), "system prune has been cancelled") expected := `WARNING! This will remove: - all stopped containers - all networks not used by at least one container @@ -35,7 +35,7 @@ func TestPrunePromptFilters(t *testing.T) { cmd := newPruneCommand(cli) cmd.SetArgs([]string{"--filter", "until=24h", "--filter", "label=hello-world", "--filter", "label!=foo=bar", "--filter", "label=bar=baz"}) - assert.ErrorContains(t, cmd.Execute(), "`system prune` has been cancelled") + assert.ErrorContains(t, cmd.Execute(), "system prune has been cancelled") expected := `WARNING! This will remove: - all stopped containers - all networks not used by at least one container diff --git a/cli/command/trust/revoke.go b/cli/command/trust/revoke.go index 773231de18..4a0d6e3af3 100644 --- a/cli/command/trust/revoke.go +++ b/cli/command/trust/revoke.go @@ -49,7 +49,7 @@ func revokeTrust(ctx context.Context, dockerCLI command.Cli, remote string, opti return err } if !deleteRemote { - return errdefs.Cancelled(errors.New("`trust revoke` has been cancelled")) + return errdefs.Cancelled(errors.New("trust revoke has been cancelled")) } } diff --git a/cli/command/trust/revoke_test.go b/cli/command/trust/revoke_test.go index c91e6845d0..36f9f8296a 100644 --- a/cli/command/trust/revoke_test.go +++ b/cli/command/trust/revoke_test.go @@ -57,7 +57,7 @@ func TestTrustRevokeCommandErrors(t *testing.T) { } func TestTrustRevokeCommand(t *testing.T) { - revokeCancelledError := "`trust revoke` has been cancelled" + revokeCancelledError := "trust revoke has been cancelled" testCases := []struct { doc string diff --git a/cli/command/utils.go b/cli/command/utils.go index ae93dbc30a..d7184f8c4e 100644 --- a/cli/command/utils.go +++ b/cli/command/utils.go @@ -123,7 +123,7 @@ func PromptForConfirmation(ctx context.Context, ins io.Reader, outs io.Writer, m select { case <-notifyCtx.Done(): // print a newline on termination - fmt.Fprintln(outs, "") + _, _ = fmt.Fprintln(outs, "") return false, ErrPromptTerminated case r := <-result: return r, nil diff --git a/cli/command/volume/prune.go b/cli/command/volume/prune.go index e1729f23c2..9aa931186b 100644 --- a/cli/command/volume/prune.go +++ b/cli/command/volume/prune.go @@ -82,7 +82,7 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions) return 0, "", err } if !r { - return 0, "", errdefs.Cancelled(errors.New("`volume prune` has been cancelled")) + return 0, "", errdefs.Cancelled(errors.New("volume prune has been cancelled")) } } diff --git a/cli/command/volume/prune_test.go b/cli/command/volume/prune_test.go index da10ae20cc..bee84dba3c 100644 --- a/cli/command/volume/prune_test.go +++ b/cli/command/volume/prune_test.go @@ -173,7 +173,7 @@ func TestVolumePrunePromptNo(t *testing.T) { cli.SetIn(streams.NewIn(io.NopCloser(strings.NewReader(input)))) cmd := NewPruneCommand(cli) cmd.SetArgs([]string{}) - assert.ErrorContains(t, cmd.Execute(), "`volume prune` has been cancelled") + assert.ErrorContains(t, cmd.Execute(), "volume prune has been cancelled") golden.Assert(t, cli.OutBuffer().String(), "volume-prune-no.golden") } }