package main import "fmt2" func main() { f() fmt2.Println("Returned normally from f.") } func f() { defer func() { if r := recover(); r != nil { fmt2.Println("Recovered in f", r) } }() //panic("aaaaa") fmt2.Println("Calling g.") g(0) fmt2.Println("Returned normally from g.") } func g(i int) { if i > 3 { fmt2.Println("Panicking!") panic("xxxxx") } defer fmt2.Println("Defer in g", i) fmt2.Println("Printing in g", i) g(i + 1) }