diff --git a/report/report.go b/report/report.go index 8875db8e..6fed5404 100644 --- a/report/report.go +++ b/report/report.go @@ -31,9 +31,9 @@ type CVEMeta struct { CVSSMeta *CVSS `yaml:",omitempty"` } type CVSS struct { - Version string `yaml:",omitempty"` - BaseScore float32 `yaml:",omitempty"` - Vector string `yaml:",omitempty"` + Version string `yaml:",omitempty"` + Score float32 `yaml:",omitempty"` + Vector string `yaml:",omitempty"` } type Report struct { diff --git a/report/utils.go b/report/utils.go index 4339e91e..3dde9f53 100644 --- a/report/utils.go +++ b/report/utils.go @@ -8,9 +8,9 @@ func CvssScoreToSeverity(cvss *CVSS) string { } switch cvss.Version { case "v2": - return cvssV2SeverityByScore(cvss.BaseScore) + return cvssV2SeverityByScore(cvss.Score) case "v3": - return cvssV3SeverityByScore(cvss.BaseScore) + return cvssV3SeverityByScore(cvss.Score) default: return "" } diff --git a/report/utils_test.go b/report/utils_test.go index b66d8fe0..efb4e1cc 100644 --- a/report/utils_test.go +++ b/report/utils_test.go @@ -23,7 +23,7 @@ func TestReverseString1(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := CvssScoreToSeverity(&CVSS{Version: tt.version, BaseScore: tt.baseScore}); got != tt.want { + if got := CvssScoreToSeverity(&CVSS{Version: tt.version, Score: tt.baseScore}); got != tt.want { t.Errorf("CvssScoreToSeverity() = %v, want %v", got, tt.want) } })