mirror of https://github.com/golang/go.git
context: update doc comment to link to context interface
Linking to the Context interface in the WithCancel doc comment makes
it more consistent with the WithDeadline and WithTimeout doc comments.
Change-Id: Ic935c63e8262784be5f3564816402221ba2fbd63
GitHub-Last-Rev: 9c6bb607a9
GitHub-Pull-Request: golang/go#65768
Reviewed-on: https://go-review.googlesource.com/c/go/+/564996
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
86a32d6d9c
commit
af5943f90c
|
|
@ -231,7 +231,7 @@ type CancelFunc func()
|
|||
// or when the parent context's Done channel is closed, whichever happens first.
|
||||
//
|
||||
// Canceling this context releases resources associated with it, so code should
|
||||
// call cancel as soon as the operations running in this Context complete.
|
||||
// call cancel as soon as the operations running in this [Context] complete.
|
||||
func WithCancel(parent Context) (ctx Context, cancel CancelFunc) {
|
||||
c := withCancel(parent)
|
||||
return c, func() { c.cancel(true, Canceled, nil) }
|
||||
|
|
|
|||
Loading…
Reference in New Issue