client/noop: fix metadata overwrite
lint / lint (pull_request) Failing after 1m29s Details
pr / test (pull_request) Failing after 2m36s Details

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-12-21 00:06:56 +03:00
parent 8058095bcc
commit 8863c10ef4
1 changed files with 3 additions and 2 deletions

View File

@ -486,11 +486,12 @@ func (n *noopClient) publish(ctx context.Context, ps []Message, opts ...PublishO
msgs := make([]*broker.Message, 0, len(ps))
for _, p := range ps {
md, ok := metadata.FromOutgoingContext(ctx)
omd, ok := metadata.FromOutgoingContext(ctx)
if !ok {
md = metadata.New(0)
omd = metadata.New(0)
}
md := metadata.Copy(omd)
iter := p.Metadata().Iterator()
var k, v string
for iter.Next(&k, &v) {