Using contexts to avoid leaking goroutines

from blog rakyll.org, | ↗ original
The context package makes it possible to manage a chain of calls within the same call path by signaling context’s Done channel. In this article, we will examine how to use the context package to avoid leaking goroutines. Assume, you have a function that starts a goroutine internally. Once this function is called, the caller may not be able to...