gosec/report/html/writer.go
2021-11-15 16:17:22 +01:00

24 lines
424 B
Go

package html
import (
// use go embed to import template
_ "embed"
"html/template"
"io"
"github.com/securego/gosec/v2"
)
//go:embed template.html
var templateContent string
// WriteReport write a report in html format to the output writer
func WriteReport(w io.Writer, data *gosec.ReportInfo) error {
t, e := template.New("gosec").Parse(templateContent)
if e != nil {
return e
}
return t.Execute(w, data)
}