diff --git a/doc/go_spec.html b/doc/go_spec.html index e8bb35f0b0..da1e2a5d24 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -5243,13 +5243,16 @@ Calls of built-in functions are restricted as for

-Each time the "defer" statement +Each time a "defer" statement executes, the function value and parameters to the call are evaluated as usual -and saved anew but the actual function body is not executed. -Instead, deferred functions are executed immediately before +and saved anew but the actual function is not invoked. +Instead, deferred functions are invoked immediately before the surrounding function returns, in the reverse order they were deferred. +If a deferred function value evaluates +to nil, execution panics +when the function is invoked not when the "defer" statement is executed.