cancel a blocking operation in Go

You can't stop a goroutine from the "outside". The goroutine has to support some kind of termination signalling (most often a channel). But if it does not, you can't force it or kill it.

If you can't do anything about the 3rd party lib you're using, the most that you could do is run it in a different process (in a different application started by your go app) which you can kill, but that is just ugly and too cumbersome.