diff --git a/doc/go_spec.html b/doc/go_spec.html index 183bc7fb37..0381ff9bae 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -7870,10 +7870,13 @@ panic(Error("cannot parse")) The recover function allows a program to manage behavior of a panicking goroutine. Suppose a function G defers a function D that calls -recover and a panic occurs in a function on the same goroutine in which G +recover and a panic occurs (i.e., panic is called) +in a function on the same goroutine in which G is executing. -When the running of deferred functions reaches D, -the return value of D's call to recover will be the value passed to the call of panic. +Subsequently, when the running of deferred functions reaches D, +the return value of D's call to recover is the value +that was previously passed to panic (i.e., at the call to panic +that caused the deferred functions to run). If D returns normally, without starting a new panic, the panicking sequence stops. In that case, the state of functions called between G and the call to panic