1
0
mirror of https://github.com/golang/go synced 2024-09-29 07:14:29 -06:00

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.
This commit is contained in:
ALX99 2024-02-17 13:29:43 +09:00
parent e41fabd688
commit 9c6bb607a9

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