Stopping goroutines from outside is not possible in golang. But yes, there are ways to do that in golang. I refer you to this post, which covers all those ways with explanations. How to kill running goroutines from outside?