mirror of
https://github.com/paleotronic/diskm8.git
synced 2024-12-22 09:30:12 +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()
|
|
|
|
}
|
|
|
|
|