mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 12:05:52 +00:00
Return err instead of panic.
This commit is contained in:
parent
143df04ede
commit
862295cb7d
1 changed files with 3 additions and 3 deletions
|
@ -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("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\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 {
|
||||
|
|
Loading…
Reference in a new issue