Merge pull request #13574 from cunnie/defer_cancel

Golang Client docs: defer `cancel()`, avoid erroring
dependabot/go_modules/go.uber.org/atomic-1.10.0
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
1 changed files with 1 additions and 1 deletions

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