add codec.RawMessage support
All checks were successful
test / test (push) Successful in 1m32s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2024-12-23 20:49:01 +03:00
parent 8233baf722
commit 5e9461f34d

View File

@ -189,6 +189,12 @@ func (c *jsonpbCodecV2) Unmarshal(d []byte, v interface{}, opts ...codec.Option)
}
}
return unmarshalOptions.Unmarshal(d, m)
case *codec.RawMessage:
*m = append((*m)[0:0], d...)
return nil
case codec.RawMessage:
copy(m, d)
return nil
default:
return codec.ErrInvalidMessage
}