Skip to content

Commit 4cd14f9

Browse files
kmcrawfordgcmurphy
authored andcommitted
remove panic
1 parent 66e7c8d commit 4cd14f9

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

output/formatter.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,26 +130,19 @@ func reportSonarqube(rootPath string, w io.Writer, data *reportInfo) error {
130130
}
131131
raw, err := json.MarshalIndent(si, "", "\t")
132132
if err != nil {
133-
panic(err)
133+
return err
134134
}
135-
136135
_, err = w.Write(raw)
137-
if err != nil {
138-
panic(err)
139-
}
140136
return err
141137
}
142138

143139
func reportJSON(w io.Writer, data *reportInfo) error {
144140
raw, err := json.MarshalIndent(data, "", "\t")
145141
if err != nil {
146-
panic(err)
142+
return err
147143
}
148144

149145
_, err = w.Write(raw)
150-
if err != nil {
151-
panic(err)
152-
}
153146
return err
154147
}
155148

0 commit comments

Comments
 (0)