@@ -12,34 +12,10 @@ import (
1212 "github.com/golangci/golangci-lint/pkg/result"
1313)
1414
15- type testSuitesXML struct {
16- XMLName xml.Name `xml:"testsuites"`
17- TestSuites []testSuiteXML
18- }
19-
20- type testSuiteXML struct {
21- XMLName xml.Name `xml:"testsuite"`
22- Suite string `xml:"name,attr"`
23- Tests int `xml:"tests,attr"`
24- Errors int `xml:"errors,attr"`
25- Failures int `xml:"failures,attr"`
26- TestCases []testCaseXML `xml:"testcase"`
27- }
28-
29- type testCaseXML struct {
30- Name string `xml:"name,attr"`
31- ClassName string `xml:"classname,attr"`
32- Failure failureXML `xml:"failure"`
33- File string `xml:"file,attr,omitempty"`
34- Line int `xml:"line,attr,omitempty"`
35- }
36-
37- type failureXML struct {
38- Message string `xml:"message,attr"`
39- Type string `xml:"type,attr"`
40- Content string `xml:",cdata"`
41- }
42-
15+ // JunitXML prints issues in the Junit XML format.
16+ // There is no official specification for the JUnit XML file format,
17+ // and various tools generate and support different flavors of this format.
18+ // https://github.com/testmoapp/junitxml
4319type JunitXML struct {
4420 extended bool
4521 w io.Writer
@@ -97,3 +73,31 @@ func (p JunitXML) Print(issues []result.Issue) error {
9773 }
9874 return nil
9975}
76+
77+ type testSuitesXML struct {
78+ XMLName xml.Name `xml:"testsuites"`
79+ TestSuites []testSuiteXML
80+ }
81+
82+ type testSuiteXML struct {
83+ XMLName xml.Name `xml:"testsuite"`
84+ Suite string `xml:"name,attr"`
85+ Tests int `xml:"tests,attr"`
86+ Errors int `xml:"errors,attr"`
87+ Failures int `xml:"failures,attr"`
88+ TestCases []testCaseXML `xml:"testcase"`
89+ }
90+
91+ type testCaseXML struct {
92+ Name string `xml:"name,attr"`
93+ ClassName string `xml:"classname,attr"`
94+ Failure failureXML `xml:"failure"`
95+ File string `xml:"file,attr,omitempty"`
96+ Line int `xml:"line,attr,omitempty"`
97+ }
98+
99+ type failureXML struct {
100+ Message string `xml:"message,attr"`
101+ Type string `xml:"type,attr"`
102+ Content string `xml:",cdata"`
103+ }
0 commit comments