1
0
mirror of https://github.com/securego/gosec.git synced 2024-12-28 21:08:22 +02:00
gosec/report.go

29 lines
661 B
Go
Raw Normal View History

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
}