diff --git a/jsonpb.go b/jsonpb.go index a219e2c..9dd66a2 100644 --- a/jsonpb.go +++ b/jsonpb.go @@ -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 }