Several recipes throughout this book make use of the context package. This recipe will explore the basics of creating and managing contexts. A good reference for understanding context is https://blog.golang.org/context. Since this blog post was written, context moved from net/context to a package called context. This still occasionally causes problems when interacting with third-party libraries such as GRPC.
This recipe will explore setting and getting values for contexts, cancelation, and timeouts.
Using the context package
Getting ready
Refer to the Getting ready section of the Using channels and the select statement recipe in this chapter.