mirror of
https://github.com/paleotronic/diskm8.git
synced 2024-11-07 23:08:58 +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()
|
|
|
|
}
|
|
|
|
|