mirror of
https://github.com/securego/gosec.git
synced 2024-11-06 12:05:52 +00:00
26f10e0a7a
* Extend the release action to sign the docker image and binary files with cosign * Fix lint warnings * Fix the ling warnings * Fix the lint warnings
23 lines
423 B
Go
23 lines
423 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)
|
|
}
|