mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43ec22429f |
No files matched your search
+1
-1
@@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
func writeJson(findings []Finding, w io.WriteCloser) error {
|
func writeJson(findings []Finding, w io.WriteCloser) error {
|
||||||
if len(findings) == 0 {
|
if len(findings) == 0 {
|
||||||
return nil
|
findings = []Finding{}
|
||||||
}
|
}
|
||||||
encoder := json.NewEncoder(w)
|
encoder := json.NewEncoder(w)
|
||||||
encoder.SetIndent("", " ")
|
encoder.SetIndent("", " ")
|
||||||
|
|||||||
+1
-2
@@ -39,9 +39,8 @@ func TestWriteJSON(t *testing.T) {
|
|||||||
}},
|
}},
|
||||||
{
|
{
|
||||||
|
|
||||||
wantEmpty: true,
|
|
||||||
testReportName: "empty",
|
testReportName: "empty",
|
||||||
expected: filepath.Join(expectPath, "report", "this_should_not_exist.json"),
|
expected: filepath.Join(expectPath, "report", "empty.json"),
|
||||||
findings: []Finding{}},
|
findings: []Finding{}},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Write(findings []Finding, cfg config.Config, ext string, reportPath string) error {
|
func Write(findings []Finding, cfg config.Config, ext string, reportPath string) error {
|
||||||
if len(findings) == 0 {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
file, err := os.Create(reportPath)
|
file, err := os.Create(reportPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
Reference in new issue
Block a user