gosec/report.go

29 lines
661 B
Go
Raw Permalink Normal View History

2021-05-20 09:16:42 +01:00
package gosec
2023-02-15 19:44:13 +00:00
import (
"github.com/securego/gosec/v2/issue"
)
2021-05-20 09:16:42 +01:00
// ReportInfo this is report information
type ReportInfo struct {
Errors map[string][]Error `json:"Golang errors"`
2023-02-15 19:44:13 +00:00
Issues []*issue.Issue
2021-05-20 09:16:42 +01:00
Stats *Metrics
GosecVersion string
}
// NewReportInfo instantiate a ReportInfo
2023-02-15 19:44:13 +00:00
func NewReportInfo(issues []*issue.Issue, metrics *Metrics, errors map[string][]Error) *ReportInfo {
2021-05-20 09:16:42 +01:00
return &ReportInfo{
Errors: errors,
Issues: issues,
Stats: metrics,
}
}
// WithVersion defines the version of gosec used to generate the report
func (r *ReportInfo) WithVersion(version string) *ReportInfo {
r.GosecVersion = version
return r
}