1 Commits

Author SHA1 Message Date
39fda18176 fixup batch publish
create correct go slice

Signed-off-by: Василий Толстов <v.tolstov@unistack.org>
2024-02-13 19:55:55 +03:00

View File

@@ -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))