feat: recreate message with parser's writer

This commit is contained in:
James Houlahan
2020-08-14 14:09:24 +02:00
parent 5343a6fc0f
commit 9821b5bbc2
6 changed files with 37 additions and 64 deletions

View File

@ -18,7 +18,6 @@
package parser
import (
"bytes"
"io"
"io/ioutil"
"os"
@ -29,15 +28,7 @@ import (
)
func newTestParser(t *testing.T, msg string) *Parser {
r := f(msg)
buf := new(bytes.Buffer)
if _, err := buf.ReadFrom(r); err != nil {
panic(err)
}
p, err := New(buf.Bytes())
p, err := New(f(msg))
require.NoError(t, err)
return p