mirror of
https://github.com/paleotronic/diskm8.git
synced 2024-12-21 18:29:43 +00:00
18 lines
193 B
Go
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()
|
|
|
|
}
|
|
|
|
|