diskm8/panic/panicwrap.go
April Ayres-Griffiths 75d42c4597 initial commit
2018-01-20 11:05:04 +11:00

18 lines
193 B
Go

package panic
func Do( f func(), h func(r interface{}) ) {
defer func() {
if r := recover(); r != nil {
h(r)
}
}()
f()
}