From ce4b75227463f4b6ba43ddca15ed8aeab0726600 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 2 Apr 2025 14:14:54 +0200 Subject: [PATCH] cli/command: TestNewDockerCliAndOperators fix unhandled errors Assert that the write succeeded; also changing `Fprintf` to `Fprint`, because we were not using templating (we should check why no linter complained about this). Signed-off-by: Sebastiaan van Stijn --- cli/command/cli_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/command/cli_test.go b/cli/command/cli_test.go index 553bbbf3f6..8e351cac11 100644 --- a/cli/command/cli_test.go +++ b/cli/command/cli_test.go @@ -280,12 +280,14 @@ func TestNewDockerCliAndOperators(t *testing.T) { assert.NilError(t, err) assert.Equal(t, string(inputStream), "input") // Check output stream - fmt.Fprintf(cli.Out(), "output") + _, err = fmt.Fprint(cli.Out(), "output") + assert.NilError(t, err) outputStream, err := io.ReadAll(outbuf) assert.NilError(t, err) assert.Equal(t, string(outputStream), "output") // Check error stream - fmt.Fprintf(cli.Err(), "error") + _, err = fmt.Fprint(cli.Err(), "error") + assert.NilError(t, err) errStream, err := io.ReadAll(errbuf) assert.NilError(t, err) assert.Equal(t, string(errStream), "error")