Documentation ¶
Overview ¶
Package safego wraps "go" call with additional recover feature to keep your goroutine away from panic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Go ¶
func Go(f func(), handlers ...RecoverHandler)
Go run the f() with a goroutine and keep it away from panic it will use defaultRecoverHandler if argument handler is nil
func GoWith ¶
func GoWith(f func(args ...interface{}), handlers ...RecoverHandler) func(args ...interface{})
GoWith run the f(...interface{}) with a goroutine and keep it away from panic eg.
GoWith(func(args ...interface{}) { }, func(err interface{}) { })(1, 0)
Types ¶
type RecoverHandler ¶
type RecoverHandler func(err interface{})
RecoverHandler when panic happen, the hander will be called
Click to show internal directories.
Click to hide internal directories.