From d1a320ec6a639c49854fb7118673665523463539 Mon Sep 17 00:00:00 2001 From: Raphael 'kena' Poss Date: Thu, 7 May 2020 16:42:55 +0200 Subject: [PATCH] lint: don't split multi-line linter outputs Release note: None --- pkg/testutils/lint/lint_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/testutils/lint/lint_test.go b/pkg/testutils/lint/lint_test.go index a265398b158d..1ca500a2b7a9 100644 --- a/pkg/testutils/lint/lint_test.go +++ b/pkg/testutils/lint/lint_test.go @@ -74,11 +74,15 @@ func vetCmd(t *testing.T, dir, name string, args []string, filters []stream.Filt return scanner.Err() })}, filters...) + var msgs strings.Builder if err := stream.ForEach(stream.Sequence(filters...), func(s string) { - t.Errorf("\n%s", s) + fmt.Fprintln(&msgs, s) }); err != nil { t.Error(err) } + if msgs.Len() > 0 { + t.Errorf("\n%s", strings.ReplaceAll(msgs.String(), "\\n++", "\n")) + } } // TestLint runs a suite of linters on the codebase. This file is