Merge pull request #13574 from cunnie/defer_cancel

Golang Client docs: defer `cancel()`, avoid erroring
This commit is contained in:
Sahdev Zala 2022-01-03 20:03:22 -05:00 committed by GitHub
commit 96a9fd0a1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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!
// }