parser/gotest: Move NewParser function below Parser struct

This commit is contained in:
Joël Stemmer 2022-06-25 23:54:07 +01:00
parent 8648745762
commit 7875e13422

View File

@ -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.
type Parser struct {
packageName string
@ -120,6 +111,15 @@ type Parser struct {
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
// gtr.Report.
func (p *Parser) Parse(r io.Reader) (gtr.Report, error) {