diff --git a/junit-formatter.go b/junit-formatter.go index da7bb13..94e2810 100644 --- a/junit-formatter.go +++ b/junit-formatter.go @@ -22,7 +22,7 @@ type JUnitTestCase struct { Classname string `xml:"classname,attr"` Name string `xml:"name,attr"` Time string `xml:"time,attr"` - Failure *string `xml:"failure"` + Failure string `xml:"failure,omitempty"` } func JUnitReportXML(report *Report, w io.Writer) error { @@ -49,15 +49,14 @@ func JUnitReportXML(report *Report, w io.Writer) error { Classname: classname, Name: test.Name, Time: formatTime(test.Time), - Failure: nil, + Failure: "", } if test.Result == FAIL { ts.Failures += 1 // TODO: set error message - msg := "" - testCase.Failure = &msg + testCase.Failure = "" } ts.TestCases = append(ts.TestCases, testCase) diff --git a/tests/02-report.xml b/tests/02-report.xml index 80933bc..1dada47 100644 --- a/tests/02-report.xml +++ b/tests/02-report.xml @@ -1,7 +1,5 @@ - - - +