Descriptionspec: clarify returns, defer statements, and panics
This is an attempt at making the interaction between
these three constructs clearer. Specifically:
- return statements terminate a function, execute deferred
functions, return to the caller, and then execution
continues after the call
- panic calls terminate a function, execute deferred
functions, return to the caller, and then re-panic
- deferred functions are executed before a function _returns_
to its caller
The hope is that with this change it becomes clear when a
deferred function is executed (when a function returns),
and when it is not (when a program exits).
Patch Set 1 #Patch Set 2 : diff -r 88c4bdf6cfb8 https://code.google.com/p/go #Patch Set 3 : diff -r 88c4bdf6cfb8 https://code.google.com/p/go #
Total comments: 6
Patch Set 4 : diff -r 88c4bdf6cfb8 https://code.google.com/p/go #Patch Set 5 : diff -r 88c4bdf6cfb8 https://code.google.com/p/go #Patch Set 6 : diff -r 88c4bdf6cfb8 https://code.google.com/p/go #
Total comments: 2
Patch Set 7 : diff -r 6f1c5f14c594 https://code.google.com/p/go #Patch Set 8 : diff -r 7d691a2266ef https://code.google.com/p/go #Patch Set 9 : diff -r 7d691a2266ef https://code.google.com/p/go #Patch Set 10 : diff -r 3da84d211bb9 https://code.google.com/p/go #MessagesTotal messages: 10
|