mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 03:55:54 +00:00
19 lines
329 B
Go
19 lines
329 B
Go
package json
|
|
|
|
import (
|
|
"encoding/json"
|
|
"io"
|
|
|
|
"github.com/securego/gosec/v2"
|
|
)
|
|
|
|
// WriteReport write a report in json format to the output writer
|
|
func WriteReport(w io.Writer, data *gosec.ReportInfo) error {
|
|
raw, err := json.MarshalIndent(data, "", "\t")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
_, err = w.Write(raw)
|
|
return err
|
|
}
|