From 39fda181761f90968540d9cc21083706601a4606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BB=D0=B8=D0=B9=20=D0=A2=D0=BE?= =?UTF-8?q?=D0=BB=D1=81=D1=82=D0=BE=D0=B2?= Date: Tue, 13 Feb 2024 19:55:55 +0300 Subject: [PATCH] fixup batch publish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit create correct go slice Signed-off-by: Василий Толстов --- nats.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nats.go b/nats.go index 9e4277e..cf72d62 100644 --- a/nats.go +++ b/nats.go @@ -204,7 +204,7 @@ func (n *natsBroker) Options() broker.Options { func (n *natsBroker) BatchPublish(ctx context.Context, p []*broker.Message, opts ...broker.PublishOption) error { var err error - msgs := make([]*nats.Msg, len(p)) + msgs := make([]*nats.Msg, 0, len(p)) var wg sync.WaitGroup wg.Add(len(p))