net/context: Don't accept a context in the DoSomethingSlow example.
The point of the DoSomething function is to protect the user from
DoSomethingSlow, which presumably doesn't support returning early upon
cancellation and deadline expiration (or else DoSomething wouldn't need
Since most of the point of the Context object is communicating deadline
and cancellation, it is misleading for DoSomethingSlow to accept a
context object. A function like DoSomething is only likely to be written
when wrapping other code that doesn't properly support contexts.
Reviewed-by: Sameer Ajmani <firstname.lastname@example.org>
1 file changed