我试着抓住恐慌
func test(/*some input*/) (output string,err111 error) {
defer func(){
if err := recover(); err != nil {
output = ""
err111 = errors.New(err.(string))
}
}()
....
}
但是 goroutine 告诉我
interface conversion: interface {} is runtime.errorString, not string
如何转储 recover() 错误并将其返回?
偶然的你
HUX布斯
相关分类