Add option to include Line field in report (#1616)

Signed-off-by: Taiki Ono <taiki@finatext.com>
This commit is contained in:
Taiki Ono authored and GitHub committed 2024-10-31 15:51:53 -05:00
1 parent dbb42a727d
commit 8e94f98e92
7 files changed
+80 -22

No files matched your search

+11
View File
@@ -6,6 +6,17 @@ import (
)
func writeJson(findings []Finding, w io.WriteCloser) error {
if len(findings) == 0 {
findings = []Finding{}
}
for i := range findings {
// Remove `Line` from JSON output
findings[i].Line = ""
}
return writeJsonExtra(findings, w)
}
func writeJsonExtra(findings []Finding, w io.WriteCloser) error {
if len(findings) == 0 {
findings = []Finding{}
}