mirror of
https://github.com/securego/gosec.git
synced 2024-12-26 04:25:52 +00:00
df14837174
* Fix unit tests for Go 1.20 * Update to Go 1.20 in the build scripts * Remove support for 1.18 in the build * Fix the golangci lint version according to Go version used * Fix golangci version string * Fix gci linter warning * Remove golint in favour of golangci
22 lines
387 B
Go
22 lines
387 B
Go
package html
|
|
|
|
import (
|
|
_ "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)
|
|
}
|