mirror of
https://github.com/jstemmer/go-junit-report.git
synced 2025-04-18 03:28:08 -05:00
parser/gotest: Move NewParser function below Parser struct
This commit is contained in:
parent
8648745762
commit
7875e13422
@ -101,15 +101,6 @@ func SetSubtestMode(mode SubtestMode) Option {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewParser returns a new Go test output parser.
|
|
||||||
func NewParser(options ...Option) *Parser {
|
|
||||||
p := &Parser{}
|
|
||||||
for _, option := range options {
|
|
||||||
option(p)
|
|
||||||
}
|
|
||||||
return p
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parser is a Go test output Parser.
|
// Parser is a Go test output Parser.
|
||||||
type Parser struct {
|
type Parser struct {
|
||||||
packageName string
|
packageName string
|
||||||
@ -120,6 +111,15 @@ type Parser struct {
|
|||||||
events []Event
|
events []Event
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewParser returns a new Go test output parser.
|
||||||
|
func NewParser(options ...Option) *Parser {
|
||||||
|
p := &Parser{}
|
||||||
|
for _, option := range options {
|
||||||
|
option(p)
|
||||||
|
}
|
||||||
|
return p
|
||||||
|
}
|
||||||
|
|
||||||
// Parse parses Go test output from the given io.Reader r and returns
|
// Parse parses Go test output from the given io.Reader r and returns
|
||||||
// gtr.Report.
|
// gtr.Report.
|
||||||
func (p *Parser) Parse(r io.Reader) (gtr.Report, error) {
|
func (p *Parser) Parse(r io.Reader) (gtr.Report, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user