Context Package
- We need a way to propagate request-scoped data down the call graph.
- We need a way to propagate cancellation signal down the call graph.
- Across API bundaries to all goroutines involved in handling a request.
Context package serves two primary purpos
- Provides API's for cancelling branches of call graph.
- Provides a data-bag for transporting request-scoped data through call graph.

Context package provides functions to create new context
- context.Background()
- context.TODO()
context.Background()
func main(){
ctx := context.Background()
}
- Background return an empty context.
- Root of any context tree.
- It is never canceled, has no value and has no deadline.
- Acts as a top level context for incoming request.
context.TODO()
func main(){
ctx := context.TODO()
}
- TODO() return an empty context.
- TODO's intended purpose is to serve as a placeholder.