Keep control of goroutines with a Context construct
When functions generate legions of goroutines to do subtasks, the main program needs to keep track and retain control of ongoing activity. To do this, Mike Schilli recommends using a Context construct.
Source: Linux Magazine Full Feed