parser/gotest: refactor parser so Parse is no longer a top level func

Making Parse a method on a Parser struct makes it possible to later
define an common parser interface.
This commit is contained in:
Joël Stemmer
2022-03-14 23:12:20 +00:00
parent 0e7d095a28
commit 832cc97037
4 changed files with 50 additions and 30 deletions

View File

@ -76,7 +76,8 @@ func main() {
in = io.TeeReader(in, os.Stdout)
}
events, err := gotest.Parse(in)
parser := gotest.New()
events, err := parser.Parse(in)
if err != nil {
exitf("error reading input: %s\n", err)
}