Skip to content

Commit

Permalink
update context example
Browse files Browse the repository at this point in the history
  • Loading branch information
hslam committed Feb 1, 2021
1 parent 721f6c2 commit b6917b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b6917b1

Please sign in to comment.