Documentation
¶
Overview ¶
Package safe 提供 panic 恢复相关的小工具:把 panic 转成带堆栈的 error, 以及安全启动 goroutine(panic 不会崩进程)。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PanicError ¶
PanicError 包装一个被 recover 的 panic 值及其堆栈。
func (*PanicError) Error ¶
func (e *PanicError) Error() string
func (*PanicError) Unwrap ¶
func (e *PanicError) Unwrap() error
Unwrap 在 panic 值本身是 error 时暴露它,便于 errors.Is/As。
Click to show internal directories.
Click to hide internal directories.