This question already has an answer here:
- cancel a blocking operation in Go 2 answers
- How to kill goroutines? [duplicate] 1 answer
- Zombie goroutines in Go 1 answer
- how to stop a goroutine 6 answers
- Break out of 3rd party goroutine that has an infinite loop 2 answers
I have a server that runs on go and it uses goroutines, sometimes happens that goorutine gets stuck (ex. infinite loop). How do I end this goroutine?
/// code
go func(){
for{} // infinite loop ; i need to kill this
}()
/// code
I expect to find a way to kill/stop this goroutine from another goroutine or in some other way
</div>