From 4cd14f90681323f6cebf7c2e837a530ef119ac21 Mon Sep 17 00:00:00 2001 From: kencrawford Date: Tue, 12 Mar 2019 20:23:45 -0400 Subject: [PATCH] remove panic --- output/formatter.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/output/formatter.go b/output/formatter.go index b8057c6..ac64a1d 100644 --- a/output/formatter.go +++ b/output/formatter.go @@ -130,26 +130,19 @@ func reportSonarqube(rootPath string, w io.Writer, data *reportInfo) error { } raw, err := json.MarshalIndent(si, "", "\t") if err != nil { - panic(err) + return err } - _, err = w.Write(raw) - if err != nil { - panic(err) - } return err } func reportJSON(w io.Writer, data *reportInfo) error { raw, err := json.MarshalIndent(data, "", "\t") if err != nil { - panic(err) + return err } _, err = w.Write(raw) - if err != nil { - panic(err) - } return err }