-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
Description
What version of Go are you using (go version
)?
$ go version
Does this issue reproduce with the latest release?
version go1.16
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env
What did you do?
package main
import (
"fmt"
)
func main(){
defer func() {
test()
}()
//defer test() //if add this line, it will work
panic("test")
}
func test() {
if err := recover(); err != nil {
fmt.Println(err)
}
}
What did you expect to see?
recovered
What did you see instead?
panic: test
goroutine 1 [running]:
main.main()
/home/letian/work/go/src/test/test.go:11 +0x5b
exit status 2