Skip to content

Commit

Permalink
Merge pull request #406 from TarsCloud/fix/read/bool
Browse files Browse the repository at this point in the history
fixbug: cpp calling go service bool reads as false when default is true
  • Loading branch information
lbbniu authored Jan 5, 2023
2 parents 8c6b567 + 4a2b703 commit e86e848
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tars/protocol/codec/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,9 @@ func (b *Reader) ReadUint8(data *uint8, tag byte, require bool) error {
// ReadBool reads the bool value for the tag and the require or optional sign.
func (b *Reader) ReadBool(data *bool, tag byte, require bool) error {
var tmp int8
if *data {
tmp = 1
}
err := b.ReadInt8(&tmp, tag, require)
if err != nil {
return err
Expand Down

0 comments on commit e86e848

Please sign in to comment.