From 713518edd7aa30fb788db2c64a0a2bd93467fe07 Mon Sep 17 00:00:00 2001 From: Zxilly Date: Tue, 5 Nov 2024 20:32:15 +0800 Subject: [PATCH] internal/sarif: ensure results follow sarif formatting requirements --- internal/sarif/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/sarif/handler.go b/internal/sarif/handler.go index 3d6f6894..972373e9 100644 --- a/internal/sarif/handler.go +++ b/internal/sarif/handler.go @@ -165,7 +165,7 @@ func rules(h *handler) []Rule { } func results(h *handler) []Result { - var results []Result + results := make([]Result, 0, len(h.findings)) for osv, fs := range h.findings { var locs []Location if h.cfg.ScanMode != govulncheck.ScanModeBinary {