Skip to content

Commit

Permalink
Merge pull request #13574 from cunnie/defer_cancel
Browse files Browse the repository at this point in the history
Golang Client docs: defer `cancel()`, avoid erroring
  • Loading branch information
spzala authored Jan 4, 2022
2 parents a96f5ee + 5620a9c commit 96a9fd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/v3/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
// To specify a client request timeout, wrap the context with context.WithTimeout:
//
// ctx, cancel := context.WithTimeout(context.Background(), timeout)
// defer cancel()
// resp, err := kvc.Put(ctx, "sample_key", "sample_value")
// cancel()
// if err != nil {
// // handle error!
// }
Expand Down

0 comments on commit 96a9fd0

Please sign in to comment.