> Be careful with locks in the form "x.Lock(); x.DoSomething(); x.Unlock()". If DoSomething panics, you will still be holding the lock, and that's pretty much the end of your program.
Interesting, thanks. But isn't panicking the end of your program anyway? Could you provide another example where no using defer causes problems?
Interesting, thanks. But isn't panicking the end of your program anyway? Could you provide another example where no using defer causes problems?