Skip to content

Commit b6917b1

Browse files
committed
update context example
1 parent 721f6c2 commit b6917b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func main() {
196196
req := &service.ArithRequest{A: 9, B: 2}
197197
var res service.ArithResponse
198198
emptyCtx := context.Background()
199-
valueCtx := context.WithValue(emptyCtx, rpc.ContextKeyBuffer, make([]byte, 64))
199+
valueCtx := context.WithValue(emptyCtx, rpc.BufferContextKey, make([]byte, 64))
200200
ctx, cancel := context.WithTimeout(valueCtx, time.Minute)
201201
defer cancel()
202202
err = conn.CallWithContext(ctx, "Arith.Multiply", req, &res)

0 commit comments

Comments
 (0)