diff --git a/cli/command/container/rm.go b/cli/command/container/rm.go index c38256a468b4..eaa23dec04bc 100644 --- a/cli/command/container/rm.go +++ b/cli/command/container/rm.go @@ -88,7 +88,6 @@ func runRm(ctx context.Context, dockerCLI command.Cli, opts *rmOptions) error { for _, name := range opts.containers { if err := <-errChan; err != nil { if opts.force && errdefs.IsNotFound(err) { - _, _ = fmt.Fprintln(dockerCLI.Err(), err) continue } errs = append(errs, err) diff --git a/cli/command/container/rm_test.go b/cli/command/container/rm_test.go index 86f6c4e0a2e9..4ab14407bb35 100644 --- a/cli/command/container/rm_test.go +++ b/cli/command/container/rm_test.go @@ -52,6 +52,7 @@ func TestRemoveForce(t *testing.T) { } else { assert.NilError(t, err) } + assert.Equal(t, cli.ErrBuffer().String(), "") sort.Strings(removed) assert.DeepEqual(t, removed, []string{"mycontainer", "nosuchcontainer"}) })