fixup batch publish
create correct go slice Signed-off-by: Василий Толстов <v.tolstov@unistack.org>
This commit is contained in:
parent
8e80aff920
commit
39fda18176
2
nats.go
2
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))
|
||||
|
Loading…
Reference in New Issue
Block a user