Skip to content

Commit

Permalink
lint: don't split multi-line linter outputs
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
knz committed May 7, 2020
1 parent 90125a7 commit d1a320e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/testutils/lint/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d1a320e

Please sign in to comment.