Skip to content

Commit 50f7057

Browse files
committed
review: simplify
1 parent ecbebb9 commit 50f7057

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkg/printers/sarif.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ func NewSarif(w io.Writer) *Sarif {
6868
}
6969

7070
func (p Sarif) Print(issues []result.Issue) error {
71-
output := SarifOutput{
72-
Version: sarifVersion,
73-
Schema: sarifSchemaURI,
74-
}
75-
7671
run := sarifRun{}
7772
run.Tool.Driver.Name = "golangci-lint"
7873

@@ -104,7 +99,11 @@ func (p Sarif) Print(issues []result.Issue) error {
10499
run.Results = append(run.Results, sr)
105100
}
106101

107-
output.Runs = []sarifRun{run}
102+
output := SarifOutput{
103+
Version: sarifVersion,
104+
Schema: sarifSchemaURI,
105+
Runs: []sarifRun{run},
106+
}
108107

109108
return json.NewEncoder(p.w).Encode(output)
110109
}

0 commit comments

Comments
 (0)