Golang recover捕获panic异常 Jackey Golang 2019-12-12 2,977 次浏览 Golang, panic, recover [codesyntax lang="c"] package main import ( "fmt" ) func test() int { defer func() { err := recover() if err != nil { fmt.Println(err) } }() var a int = 10 var b int = 0 return a/b } ...