2021-05-20 10:16:42 +02:00
|
|
|
package gosec
|
|
|
|
|
2023-02-15 21:44:13 +02:00
|
|
|
import (
|
|
|
|
"github.com/securego/gosec/v2/issue"
|
|
|
|
)
|
|
|
|
|
2021-05-20 10:16:42 +02:00
|
|
|
// ReportInfo this is report information
|
|
|
|
type ReportInfo struct {
|
|
|
|
Errors map[string][]Error `json:"Golang errors"`
|
2023-02-15 21:44:13 +02:00
|
|
|
Issues []*issue.Issue
|
2021-05-20 10:16:42 +02:00
|
|
|
Stats *Metrics
|
|
|
|
GosecVersion string
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewReportInfo instantiate a ReportInfo
|
2023-02-15 21:44:13 +02:00
|
|
|
func NewReportInfo(issues []*issue.Issue, metrics *Metrics, errors map[string][]Error) *ReportInfo {
|
2021-05-20 10:16:42 +02: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
|
|
|
|
}
|