From f1052799894cc8a8480ff28e1c717a9d811876a2 Mon Sep 17 00:00:00 2001 From: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com> Date: Thu, 10 Aug 2023 09:58:42 +0600 Subject: [PATCH] fix(report): return severity colors in table format (#4969) * use xio.NopCloser to compare with os.Stdout * fmt of import --- pkg/report/table/table.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/report/table/table.go b/pkg/report/table/table.go index b468a7c2b3db..9542c7b6048e 100644 --- a/pkg/report/table/table.go +++ b/pkg/report/table/table.go @@ -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 ( @@ -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()