Documentation ¶
Index ¶
- Variables
- func Break[T any](pre error) func(f func() (T, error)) (T, error)
- func Concern[T any](_ T, err error) error
- func Continue[T any](pre error) func(f func() (T, error)) (T, error)
- func Equals(err, target error) bool
- func Ignore[T any](v T, _ error) T
- func Join(err error, errs ...error) error
- func Must[T any](v T, err error) T
- func Quiet[T any](v T, err error) T
- func Silence(_ error)
- func Stringfy(err error) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorType = reflect.TypeOf((*error)(nil)).Elem()
Functions ¶
func Break ¶
Break 函数是一个高阶函数,用于处理错误并决定是否继续执行另一个函数。 如果pre参数不为nil,它会返回一个零值和pre错误,从而中断后续的执行; 如果pre为nil,则会调用并返回f()的结果。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.