Documentation ¶
Index ¶
- Variables
- func BeTrue(ok bool, args ...any)
- func Func(errFunc func() error, args ...interface{})
- func Int(n int, err error, args ...interface{}) int
- func NonNil[T any](t *T, args ...any) *T
- func Ok(err error, args ...interface{})
- func Ok1[R any](retval R, err error, args ...interface{}) R
- func Ok2[R1 any, R2 any](retval1 R1, retval2 R2, err error, args ...interface{}) (R1, R2)
- func Ok3[R1, R2, R3 any](retval1 R1, retval2 R2, retval3 R3, err error, args ...interface{}) (R1, R2, R3)
- func Ok4[R1, R2, R3, R4 any](retval1 R1, retval2 R2, retval3 R3, retval4 R4, err error, args ...interface{}) (R1, R2, R3, R4)
- func Ok5[R1, R2, R3, R4, R5 any](retval1 R1, retval2 R2, retval3 R3, retval4 R4, retval5 R5, err error, ...) (R1, R2, R3, R4, R5)
- func OrDo(err error, do func(any), args []interface{})
- func OrPanic(err error, args []interface{})
- func Rel(basePath, targetPath string) string
- func Str(s string, err error, args ...interface{}) string
- func Val(v interface{}, err error) beOkT
Constants ¶
This section is empty.
Variables ¶
var (
ErrNil = errors.New("is nil")
)
Functions ¶
func Ok ¶
func Ok(err error, args ...interface{})
1. Ok() does nothing if err == nil 2. Otherwise if no args are given Ok() will panic(err) 3. Otherwise the first args can be error's. if err Is one of them Ok() does nothing 4. Otherwise the next arg can be a format string for fmt.Sprintf(). If so it will be passed with the remaining args to Sprintf() and Ok() will panic with that message 5. Otherwise Ok() will panic with fmt.Sprint(args...)
func OrPanic ¶
func OrPanic(err error, args []interface{})
1. OrPanic() does nothing if err == nil 2. Otherwise if no args are given OrPanic() will panic(err) 3. Otherwise the first arg can be a format string for fmt.Sprintf(). If so it will be passed with the remaining args to Sprintf() and OrPanic() will panic with that message 4. Otherwise OrPanic() will panic with fmt.Sprint(args...)
Types ¶
This section is empty.