August 2019
Beginner to intermediate
798 pages
17h 2m
English
In this section, you are going to learn even more about the context package because it is such a powerful and unique package of the Go standard library. This time, we are going to create a context that uses the context.TODO() function instead of the context.Background() function. Although both functions return a non-nil, empty Context, their purposes differ. We are also going to illustrate the use of the context.WithValue() function. The name of the program that will be developed in this section is moreContext.go, and it will be presented in four parts.
The first part of moreContext.go is as follows:
package main
import (
"context"
"fmt"
)
type aKey string
The second part of moreContext.go contains ...
Read now
Unlock full access