Skip to content

Commit

Permalink
refactor: remove the TTransport in apache bridge module
Browse files Browse the repository at this point in the history
  • Loading branch information
YangruiEmma committed Aug 15, 2024
1 parent c6f9aa9 commit 3970408
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions protocol/thrift/apache/apache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestThriftReadWrite(t *testing.T) {

buf := &bytes.Buffer{}

err = ThriftWrite(NewBufferTransport(buf), v)
err = ThriftWrite(buf, v)
require.Same(t, err, errThriftWriteNotRegistered)

RegisterThriftWrite(callThriftWrite)
Expand Down Expand Up @@ -84,18 +84,18 @@ func checkTStruct(v interface{}) error {
return nil
}

func callThriftRead(t TTransport, v interface{}) error {
func callThriftRead(rw io.ReadWriter, v interface{}) error {
p, ok := v.(TStruct)
if !ok {
return errNotThriftTStruct
}
return p.Read(t)
return p.Read(rw)
}

func callThriftWrite(t TTransport, v interface{}) error {
func callThriftWrite(rw io.ReadWriter, v interface{}) error {
p, ok := v.(TStruct)
if !ok {
return errNotThriftTStruct
}
return p.Write(t)
return p.Write(rw)
}

0 comments on commit 3970408

Please sign in to comment.