This means that if you do:
func (f Foo) String() string { some.Lock() t := get_something() some.Unlock() t = transform_it(t) return t }
It's non-optional to use defer, and thus write exception safe code. Even if you never use exceptions.
This means that if you do:
And `get_something()` panics, then the program continues with a locked mutex. There are more dangerous things than a deadlocked program, of course.It's non-optional to use defer, and thus write exception safe code. Even if you never use exceptions.