The recovered state is stored in `Frame`, and captured in `runCfg()`.
`assign()` has been modified to set handle `interface{}` type (not
possible with `reflect`.
18 lines
195 B
Go
18 lines
195 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func main() {
|
|
println("hello")
|
|
defer func() {
|
|
r := recover()
|
|
fmt.Println("recover:", r)
|
|
}()
|
|
println("world")
|
|
}
|
|
|
|
// Output:
|
|
// hello
|
|
// world
|
|
// recover: <nil>
|