Skip to content

Commit

Permalink
Documentation: fix outgoing metadata example code (grpc#3979)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjheng authored and davidkhala committed Dec 7, 2020
1 parent 18a4d41 commit 106e242
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Documentation/grpc-metadata.md
Expand Up @@ -110,9 +110,9 @@ md := metadata.Pairs("k1", "v1", "k1", "v2", "k2", "v3")
ctx := metadata.NewOutgoingContext(context.Background(), md)

// later, add some more metadata to the context (e.g. in an interceptor)
md, _ := metadata.FromOutgoingContext(ctx)
send, _ := metadata.FromOutgoingContext(ctx)
newMD := metadata.Pairs("k3", "v3")
ctx = metadata.NewContext(ctx, metadata.Join(metadata.New(send), newMD))
ctx = metadata.NewOutgoingContext(ctx, metadata.Join(send, newMD))

// make unary RPC
response, err := client.SomeRPC(ctx, someRequest)
Expand Down

0 comments on commit 106e242

Please sign in to comment.