package main
type gopher struct{}
func (g *gopher) selfRecover() (r bool) {
if b, ok := recover().(*gopher); ok {
r = g == b
}
return
}
func main() {
var g gopher
defer g.selfRecover()
panic(&g)
}
marcin-janas / hello-go Goto Github PK
View Code? Open in Web Editor NEWMy place to collect information about Go
License: MIT License