Files
gitleaks/report/json.go
T
Zachary Rice 93f292c3df Introducing v8.0.0 changes (#701)
* Introducing v8.0.0 changes
2021-11-22 10:43:51 -06:00

16 lines
248 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)
}