From 327b2a0841836d0fce89ef79b3050e7b255dd533 Mon Sep 17 00:00:00 2001 From: Mark Wolfe Date: Thu, 21 Jan 2021 20:21:59 +1100 Subject: [PATCH] ensure the sarif results are an empty array if nothing is reported --- output/formatter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output/formatter.go b/output/formatter.go index feedb07..5631b86 100644 --- a/output/formatter.go +++ b/output/formatter.go @@ -182,7 +182,7 @@ func convertToSarifReport(rootPaths []string, data *reportInfo) (*sarifReport, e var rules []*sarifRule var locations []*sarifLocation - var results []*sarifResult + results := []*sarifResult{} for index, issue := range data.Issues { rules = append(rules, buildSarifRule(issue))