Background is an empty context that doesn't get cancelled, hasn't got a deadline, and doesn't hold any values. It is mostly used by the main function as the root context or for testing purposes. The following is some example code for this context:
func main() {
ctx := context.Background()
done := ctx.Done()
for i :=0; ;i++{
select {
case <-done:
return
case <-time.After(time.Second):
fmt.Println("tick", i)
}
}
}
The full example is available here: https://play.golang.org/p/y_3ip7sdPnx.
We can see that, in the context of the example, the loop goes on infinitely because the context is never completed.