no need to return string when using io.Writer anyway

This commit is contained in:
2022-10-17 23:40:53 +02:00
parent 1b2f51dcaf
commit 4481f59eda
2 changed files with 28 additions and 25 deletions

View File

@@ -279,11 +279,15 @@ func TestPrinter(t *testing.T) {
}
testdata := mockdata
output := strings.TrimSpace(printData(&w, &testdata))
exp := strings.TrimSpace(tt.expect)
if output != exp {
printData(&w, &testdata)
got := strings.TrimSpace(w.String())
if got != exp {
t.Errorf("not rendered correctly:\n+++ got:\n%s\n+++ want:\n%s",
output, exp)
got, exp)
}
})
}