gosec/report/yaml/writer.go

20 lines
316 B
Go
Raw Normal View History

package yaml
import (
"io"
2021-05-20 09:16:42 +01:00
"gopkg.in/yaml.v3"
"github.com/securego/gosec/v2"
)
// WriteReport write a report in yaml format to the output writer
2021-05-20 09:16:42 +01: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
}