package main import ( "fmt" "time" ) func main() { for true{ defer func() { if e := recover(); e != nil { fmt.Println(e) } }() barking() time.Sleep(time.Second) } } func barking() { defer func() { if e := recover(); e != nil { fmt.Println(e) } }() bak() } func bak() { panic("bing dog barking") }