From 862295cb7d907671c4c27abda5549c32e0a16cd6 Mon Sep 17 00:00:00 2001 From: Delon Wong Her Laang Date: Tue, 30 Jan 2018 09:54:30 +0800 Subject: [PATCH] Return err instead of panic. --- output/formatter.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/output/formatter.go b/output/formatter.go index 572e807..d829c53 100644 --- a/output/formatter.go +++ b/output/formatter.go @@ -124,17 +124,17 @@ func reportJUnitXML(w io.Writer, data *reportInfo) error { raw, err := xml.MarshalIndent(junitXMLStruct, "", "\t") if err != nil { - panic(err) + return err } xmlHeader := []byte("\n") raw = append(xmlHeader, raw...) _, err = w.Write(raw) if err != nil { - panic(err) + return err } - return err + return nil } func reportFromPlaintextTemplate(w io.Writer, reportTemplate string, data *reportInfo) error {