context: CancelFunc isn't documented to be safe for simultaneous use by multiple goroutines #32145
Labels
Documentation
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
There are two types defined in the
context
package. The documentation makes it very clear that thecontext.Context
type and its methods are safe for simultaneous use by multiple goroutines:In the package comment:
In the
context.Context
type documentation:There is another type in the context package, the
context.CancelFunc
type. It is currently documented as:It states that after the first call, subsequent calls to a CancelFunc do nothing. The three
With*
methods that return a Context and CancelFunc say:As I understand it, the documentation does not state that ContextFunc is safe for simultaneous use by multiple goroutines. Is that a documentation bug?
/cc @Sajmani, @bradfitz as owners; also /cc @mvdan
The text was updated successfully, but these errors were encountered: