fix: use voidprinter for html output
We should not print anything but the scan output when we send output to stdout.main
parent
0547292e67
commit
70bcd60fbd
|
@ -89,6 +89,11 @@ func GetPrinter(config OutputConfig, quiet bool) output.Printer {
|
||||||
return &output.VoidPrinter{}
|
return &output.VoidPrinter{}
|
||||||
}
|
}
|
||||||
fallthrough
|
fallthrough
|
||||||
|
case HTMLOutputType:
|
||||||
|
if isStdOut(config.Path) {
|
||||||
|
return &output.VoidPrinter{}
|
||||||
|
}
|
||||||
|
fallthrough
|
||||||
case ConsoleOutputType:
|
case ConsoleOutputType:
|
||||||
fallthrough
|
fallthrough
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -529,6 +529,18 @@ func TestGetPrinter(t *testing.T) {
|
||||||
key: PlanOutputType,
|
key: PlanOutputType,
|
||||||
want: &output.VoidPrinter{},
|
want: &output.VoidPrinter{},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "html stdout output",
|
||||||
|
path: "stdout",
|
||||||
|
key: HTMLOutputType,
|
||||||
|
want: &output.VoidPrinter{},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "html /dev/stdout output",
|
||||||
|
path: "/dev/stdout",
|
||||||
|
key: HTMLOutputType,
|
||||||
|
want: &output.VoidPrinter{},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue