Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 to exist). 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. Change-Id: Ibdef5b7ed71387ba6a09179ef2f911fc3f98e40a Reviewed-on: https://go-review.googlesource.com/3902 Reviewed-by: Sameer Ajmani <[email protected]>
- Loading branch information