What version of Go are you using (go version)?
go version go1.13 linux/amd64
Does this issue reproduce with the latest release?
Yes
What did you do?
package main
import "fmt"
func demo() {
defer func() {
defer func() {
// recover panic 2
fmt.Println("panic", recover(), "is recovered")
}()
// recover panic 1
defer fmt.Println(" (done).")
defer recover()
defer fmt.Print("To recover panic 1 ...")
defer fmt.Println("now, two active panics coexist")
panic(2) // If this line is commented out, then the program will not crash.
}()
panic(1)
}
func main() {
demo()
}
What did you expect to see?
Not crash.
What did you see instead?
Crashes.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes
What did you do?
What did you expect to see?
Not crash.
What did you see instead?
Crashes.