Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Nephin <dnephin@gmail.com>
  • Loading branch information
dagood and dnephin committed May 12, 2021
1 parent cee4211 commit 5707a34
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions testjson/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,8 @@ type ScanConfig struct {
Execution *Execution
// Stop is called when ScanTestOutput fails during a scan.
Stop func()
// IgnoreNonJSONOutputLines causes ScanTestOutput to print non-JSON lines to
// stderr rather than returning an error.
// IgnoreNonJSONOutputLines causes ScanTestOutput to ignore non-JSON lines received from
// the Stdout reader. Instead of causing an error, the lines will be sent to Handler.Err.
IgnoreNonJSONOutputLines bool
}

Expand Down Expand Up @@ -667,7 +667,8 @@ func readStdout(config ScanConfig, execution *Execution) error {
continue
case err != nil:
if config.IgnoreNonJSONOutputLines {
fmt.Fprintf(os.Stderr, "%s\n", raw)
// nolint: errcheck
config.Handler.Err(string(raw))
continue
}
return errors.Wrapf(err, "failed to parse test output: %s", string(raw))
Expand Down

0 comments on commit 5707a34

Please sign in to comment.