We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3eccd49 commit d178445Copy full SHA for d178445
runner/runner.go
@@ -49,18 +49,21 @@ func (r *Runner) Run() error {
49
}
50
51
52
+ var outputWriters []io.Writer
53
if r.options.OutputFile != "" {
54
file, err := os.Create(r.options.OutputFile)
55
if err != nil {
56
return err
57
- r.options.Output = file
58
+ outputWriters = append(outputWriters, file)
59
60
- if r.options.OutputFile != "" && r.options.DisplayInJSON {
61
- r.options.Output = io.MultiWriter(r.options.Output, os.Stdout)
+ if !r.options.DisplayInCSV {
62
+ outputWriters = append(outputWriters, os.Stdout)
63
64
65
+ r.options.Output = io.MultiWriter(outputWriters...)
66
+
67
if r.options.DisplayInCSV {
68
w := csv.NewWriter(r.options.Output)
69
w.Comma = '|'
0 commit comments