From 649c4b898713080906f5ac86e0c981b22d73844c Mon Sep 17 00:00:00 2001 From: "Yusuf A. Hasan Miyan" Date: Tue, 13 Feb 2024 16:56:39 +0400 Subject: [PATCH] fix: simplify filecheck breach message --- pkg/checks/file/filecheck.go | 5 ++--- pkg/checks/file/filecheck_test.go | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/checks/file/filecheck.go b/pkg/checks/file/filecheck.go index 6b168c3..cfae940 100644 --- a/pkg/checks/file/filecheck.go +++ b/pkg/checks/file/filecheck.go @@ -1,7 +1,6 @@ package file import ( - "fmt" "path/filepath" "strings" @@ -66,7 +65,7 @@ func (c *FileCheck) RunCheck() { return } c.AddBreach(&result.ValueBreach{ - ValueLabel: fmt.Sprintf("%s - illegal files found", c.Name), - Value: strings.Join(files, "\n"), + ValueLabel: "illegal files found", + Value: strings.Join(files, ","), }) } diff --git a/pkg/checks/file/filecheck_test.go b/pkg/checks/file/filecheck_test.go index 86ae552..61d6a5c 100644 --- a/pkg/checks/file/filecheck_test.go +++ b/pkg/checks/file/filecheck_test.go @@ -86,8 +86,8 @@ func TestFileCheckRunCheck(t *testing.T) { CheckType: "file", CheckName: "filecheck2", Severity: "normal", - ValueLabel: "filecheck2 - illegal files found", - Value: "testdata/adminer.php\ntestdata/sub/phpmyadmin.php", + ValueLabel: "illegal files found", + Value: "testdata/adminer.php,testdata/sub/phpmyadmin.php", }, }, c.Result.Breaches,