Skip to content

Commit

Permalink
fix(report): return severity colors in table format (#4969)
Browse files Browse the repository at this point in the history
* use xio.NopCloser to compare with os.Stdout

* fmt of import
  • Loading branch information
DmitriyLewen authored Aug 10, 2023
1 parent bc2b0ca commit f105279
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/report/table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/aquasecurity/table"
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy/pkg/types"
xio "github.com/aquasecurity/trivy/pkg/x/io"
)

var (
Expand Down Expand Up @@ -137,7 +138,7 @@ func IsOutputToTerminal(output io.Writer) bool {
return false
}

if output != os.Stdout {
if output != xio.NopCloser(os.Stdout) {
return false
}
o, err := os.Stdout.Stat()
Expand Down

0 comments on commit f105279

Please sign in to comment.