gosec/report/html/writer.go
Cosmin Cojocar df14837174
Update to Go 1.20 and fix unit tests (#923)
* 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
2023-02-06 14:15:05 +01:00

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)
}