This question already has an answer here:
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>