mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-13 08:00:53 -08:00
fix(report): return severity colors in table format (#4969)
* use xio.NopCloser to compare with os.Stdout * fmt of import
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
|||||||
"github.com/aquasecurity/table"
|
"github.com/aquasecurity/table"
|
||||||
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
|
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
|
||||||
"github.com/aquasecurity/trivy/pkg/types"
|
"github.com/aquasecurity/trivy/pkg/types"
|
||||||
|
xio "github.com/aquasecurity/trivy/pkg/x/io"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -137,7 +138,7 @@ func IsOutputToTerminal(output io.Writer) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if output != os.Stdout {
|
if output != xio.NopCloser(os.Stdout) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
o, err := os.Stdout.Stat()
|
o, err := os.Stdout.Stat()
|
||||||
|
|||||||
Reference in New Issue
Block a user