Files
gitleaks/report/json.go
T
Zachary Rice ce42947cae fix deduplication issue caused by clobbered findings (#742)
* fix deduplication issue caused by clobbered findings

* fix index

* remove indexing, slow is better than wrong
2021-12-07 19:11:37 -06:00

16 lines
247 B
Go

package report
import (
"encoding/json"
"io"
)
func writeJson(findings []Finding, w io.WriteCloser) error {
if len(findings) == 0 {
return nil
}
encoder := json.NewEncoder(w)
encoder.SetIndent("", " ")
return encoder.Encode(findings)
}