Compare commits

..

1 Commits
v3.10.2 ... v3

Author SHA1 Message Date
0715891c86 update codec to allow reuse buffers
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2024-09-17 08:29:40 +03:00

View File

@ -142,7 +142,7 @@ func (c *jsonpbCodecV2) Marshal(d []byte, v interface{}, opts ...codec.Option) (
marshalOptions = f marshalOptions = f
} }
} }
return marshalOptions.MarshalAppend(d, m) return marshalOptions.MarshalAppend(d[:0], m)
default: default:
return nil, codec.ErrInvalidMessage return nil, codec.ErrInvalidMessage
} }