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: 9c6bb607a94f6f4cd27cc3f5e39c192e088ab386
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:
ALX99 2024-02-17 04:43:34 +00:00 committed by Gopher Robot
parent 86a32d6d9c
commit af5943f90c

View File

@ -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) }