diff --git a/grype/presenter/sarif/presenter_test.go b/grype/presenter/sarif/presenter_test.go index 5ce51fd6..e2790fc9 100644 --- a/grype/presenter/sarif/presenter_test.go +++ b/grype/presenter/sarif/presenter_test.go @@ -355,7 +355,7 @@ type MockMetadataProvider struct{} func (m *MockMetadataProvider) GetMetadata(id, namespace string) (*vulnerability.Metadata, error) { cvss := func(id string, namespace string, scores ...float64) vulnerability.Metadata { - values := make([]vulnerability.Cvss, len(scores)) + values := make([]vulnerability.Cvss, 0, len(scores)) for _, score := range scores { values = append(values, vulnerability.Cvss{ Metrics: vulnerability.CvssMetrics{