You cannot stop goroutine from the outside. Gorotin should support some signaling about completion (most often the channel). But if it is not, you cannot force him or kill him.
If you canβt do anything about what you are using, you can use it in another process (in another application launched by your application) that you can kill, but it's just ugly and too cumbersome.
source share