mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 21:24:21 +01:00
Add option to include Line field in report (#1616)
Signed-off-by: Taiki Ono <taiki@finatext.com>
This commit is contained in:
1 parent
dbb42a727d
commit
8e94f98e92
7 files changed
+80
-22
No files matched your search
@@ -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{}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user