mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
16 lines
248 B
Go
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)
|
|
}
|