From 6444f16f00054f205ef9a91cf1ea018ed58ce31c Mon Sep 17 00:00:00 2001 From: Aaron Jheng Date: Thu, 22 Oct 2020 22:13:51 +0800 Subject: [PATCH] Fix error docs --- Documentation/grpc-metadata.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/grpc-metadata.md b/Documentation/grpc-metadata.md index c278a98ef8c7..ff4de6e71de3 100644 --- a/Documentation/grpc-metadata.md +++ b/Documentation/grpc-metadata.md @@ -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)