From bb635e0a1fbbd48874fe931026b595e246b0786b Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 17 Sep 2024 08:30:51 +0300 Subject: [PATCH] update codec to allow reuse buffers Signed-off-by: Vasiliy Tolstov --- proto.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto.go b/proto.go index 9b99401..6c2ae1c 100644 --- a/proto.go +++ b/proto.go @@ -138,7 +138,7 @@ func (c *protoCodecV2) Marshal(d []byte, v interface{}, opts ...codec.Option) ([ marshalOptions = f } } - return marshalOptions.MarshalAppend(d, m) + return marshalOptions.MarshalAppend(d[:0], m) default: return nil, codec.ErrInvalidMessage }