少于1分钟
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
package main import "fmt" func main() { defer func() { if r := recover(); r != nil { fmt.Printf("%v,%T\n", r, r) } }() panic("a problem") } // Output: // a problem,string