Safe function execution without panic
To install the package, run:
go get github.com/go-zoox/safe
import (
"testing"
"github.com/go-zoox/safe"
)
func main(t *testing.T) {
loadConfig := func() {
panic("load config panic")
}
if err := safe.Do(loadConfig); err != nil {
log.Error(err)
}
}
- kenkyu392/go-safe - Provides a sandbox for the safe execution of panic-inducing programs
- go-zoox/retry - Catch Panic In Retries
GoZoox is released under the MIT License.