Simplify rows event decoding

This commit is contained in:
2018-11-11 14:33:26 +01:00
parent 69353f61bc
commit 8cbca43cf7
2 changed files with 10 additions and 3 deletions
+1 -3
View File
@@ -12,7 +12,6 @@ import (
"time"
"github.com/google/go-cmp/cmp"
"github.com/localhots/bocadillo/binlog"
"github.com/localhots/bocadillo/mysql"
"github.com/localhots/bocadillo/reader"
)
@@ -200,8 +199,7 @@ func (s *testSuite) expectValue(t *testing.T, tbl *table, exp interface{}) {
return
}
if evt.Table != nil && evt.Table.TableName == tbl.name {
re := binlog.RowsEvent{Type: evt.Header.Type}
err := re.Decode(evt.Buffer, evt.Format, *evt.Table)
re, err := evt.DecodeRows()
if err != nil {
t.Fatalf("Failed to decode rows event: %v", err)
}