package main
import "fmt"
func main() {
fn1()
fmt.Println("hello go")
}
func fn1() {
defer func() {
if r := recover(); r != nil {
fmt.Println("恢复from panic ~: ", r)
}
}()
panic("This is a panic!")
}
// 恢复from panic ~: This is a panic!
// hello go