reading mask without preceding nil value
This commit is contained in:
parent
800c5d04d0
commit
de9695a724
|
@ -530,25 +530,15 @@ func (rd *msgpackReader) Skip() error {
|
|||
}
|
||||
|
||||
func (rd *msgpackReader) TryReadMask() (bool, FieldsMask, error) {
|
||||
code, err := rd.dec.PeekCode()
|
||||
maskLen, err := rd.dec.DecodeArrayLen()
|
||||
if err != nil {
|
||||
return false, FieldsMask{}, errors.WithStack(err)
|
||||
}
|
||||
|
||||
if code != msgpcode.Nil {
|
||||
if err == io.EOF {
|
||||
return false, FieldsMask{}, nil
|
||||
}
|
||||
|
||||
if err := rd.dec.Skip(); err != nil {
|
||||
return false, FieldsMask{}, errors.WithStack(err)
|
||||
}
|
||||
|
||||
var mask FieldsMask
|
||||
maskLen, err := rd.dec.DecodeArrayLen()
|
||||
if err != nil {
|
||||
return false, FieldsMask{}, errors.WithStack(err)
|
||||
}
|
||||
|
||||
for i := 0; i < maskLen; i++ {
|
||||
maskPart, err := rd.dec.DecodeUint64()
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue