From b6917b1cd03de8141dbd2bb4835356f4a20375f9 Mon Sep 17 00:00:00 2001 From: hslam <791874158@qq.com> Date: Mon, 1 Feb 2021 13:11:33 +0800 Subject: [PATCH] update context example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a29374e..46c13de 100644 --- a/README.md +++ b/README.md @@ -196,7 +196,7 @@ func main() { req := &service.ArithRequest{A: 9, B: 2} var res service.ArithResponse emptyCtx := context.Background() - valueCtx := context.WithValue(emptyCtx, rpc.ContextKeyBuffer, make([]byte, 64)) + valueCtx := context.WithValue(emptyCtx, rpc.BufferContextKey, make([]byte, 64)) ctx, cancel := context.WithTimeout(valueCtx, time.Minute) defer cancel() err = conn.CallWithContext(ctx, "Arith.Multiply", req, &res)