From 14398b776e15bf10699af04bbd970db5167fc3ae Mon Sep 17 00:00:00 2001 From: xixishidibei Date: Wed, 18 Sep 2024 23:56:42 +0800 Subject: [PATCH] test: fix slice init length (#2133) Signed-off-by: xixishidibei --- grype/presenter/sarif/presenter_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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{