fixup batch publish

create correct go slice

Signed-off-by: Василий Толстов <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2024-02-13 19:55:55 +03:00
parent 8e80aff920
commit 39fda18176

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 { func (n *natsBroker) BatchPublish(ctx context.Context, p []*broker.Message, opts ...broker.PublishOption) error {
var err error var err error
msgs := make([]*nats.Msg, len(p)) msgs := make([]*nats.Msg, 0, len(p))
var wg sync.WaitGroup var wg sync.WaitGroup
wg.Add(len(p)) wg.Add(len(p))