Skip to content

Commit

Permalink
Update compact_protocol.go
Browse files Browse the repository at this point in the history
  • Loading branch information
donnie4w committed Nov 22, 2023
1 parent 8bf311a commit 15ee811
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thrift/compact_protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package thrift

import (
"bytes"
"context"
"encoding/binary"
"errors"
Expand Down Expand Up @@ -366,6 +365,7 @@ func (p *TCompactProtocol) _writeString(value string) (n int, e error) {
}
return
}

func (p *TCompactProtocol) _writeByte(value byte) (e error) {
if p.transBuffer != nil {
e = p.transBuffer.WriteByte(value)
Expand Down Expand Up @@ -694,7 +694,7 @@ func (p *TCompactProtocol) ReadUUID(ctx context.Context) (value Tuuid, err error
func (p *TCompactProtocol) Flush(ctx context.Context) (err error) {
if p.transBuffer != nil {
p.trans.Write(p.transBuffer.Bytes())
p.transBuffer.Buffer = &bytes.Buffer{}
p.transBuffer = NewTMemoryBuffer()
}
return NewTProtocolException(p.trans.Flush(ctx))
}
Expand Down

0 comments on commit 15ee811

Please sign in to comment.