In this chapter, we looked at what one of the newer packages, context, is all about. We saw that Context is a simple interface that has four methods, and should be used as the first argument of a function. Its main scope is to handle cancellation and deadlines to synchronize concurrent operations and provide the user with functionality to cancel an operation.
We saw how the default contexts, Background and TODO, don't allow cancellation, but they can be extended using various functions of the package to add timeouts or cancellation. We also talked about the capabilities of context when it comes to holding values and how this should be used carefully in order to avoid shadowing and other problems.
Then, we dived into the standard package to see where context is already used. This included the HTTP capabilities of requests, where it can be used for values...