1
0
mirror of https://github.com/securego/gosec.git synced 2025-01-26 03:20:13 +02:00
gosec/report/yaml/writer.go

19 lines
315 B
Go
Raw Normal View History

package yaml
import (
"io"
2021-05-20 10:16:42 +02:00
"github.com/securego/gosec/v2"
"gopkg.in/yaml.v3"
)
// WriteReport write a report in yaml format to the output writer
2021-05-20 10:16:42 +02:00
func WriteReport(w io.Writer, data *gosec.ReportInfo) error {
raw, err := yaml.Marshal(data)
if err != nil {
return err
}
_, err = w.Write(raw)
return err
}