assert

package module
v0.1.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2019 License: MIT Imports: 6 Imported by: 14

README

assert

assert for go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrWrap added in v0.1.4

func ErrWrap(err error, fn func(m *M))

func If added in v0.0.4

func If(b bool, t, f interface{}) interface{}

func IfEquals added in v0.0.4

func IfEquals(args ...interface{}) bool

func IfIn added in v0.0.4

func IfIn(a interface{}, args ...interface{}) bool

func IfNotIn added in v0.0.4

func IfNotIn(a interface{}, args ...interface{}) bool

func IsAllNil added in v0.1.15

func IsAllNil(args ...interface{}) bool

func IsAllNotNil added in v0.1.15

func IsAllNotNil(args ...interface{}) bool

func IsNil added in v0.1.15

func IsNil(p interface{}) (b bool)

func KTry added in v0.1.15

func KTry(fn func()) (err error)

func ObjOf added in v0.1.15

func ObjOf(args ...interface{}) []interface{}

func P

func P(d ...interface{})

func ST added in v0.1.13

func ST(b bool, msg string, args ...interface{})

func SWrap added in v0.1.13

func SWrap(err error, msg string, args ...interface{})

func StrOf added in v0.1.15

func StrOf(args ...string) []string

func T added in v0.1.13

func T(b bool, fn func(m *M))

func Throw added in v0.1.12

func Throw(err error)

func ToInt added in v0.1.15

func ToInt(p string) int

func Try added in v0.1.15

func Try(fn func()) (r interface{})

Types

type FnT added in v0.1.15

type FnT func() []reflect.Value

func FnOf added in v0.1.15

func FnOf(fn interface{}, args ...interface{}) FnT

type KErr added in v0.0.13

type KErr struct {
	Tag    string                 `json:"tag,omitempty"`
	M      map[string]interface{} `json:"m,omitempty"`
	Err    error                  `json:"err,omitempty"`
	Msg    string                 `json:"msg,omitempty"`
	Caller string                 `json:"caller,omitempty"`
	Sub    *KErr                  `json:"sub,omitempty"`
}

func (*KErr) Error added in v0.0.13

func (t *KErr) Error() string

func (*KErr) P added in v0.1.4

func (t *KErr) P()

func (*KErr) Panic added in v0.1.3

func (t *KErr) Panic()

func (*KErr) StackTrace added in v0.1.11

func (t *KErr) StackTrace() interface{}

type M added in v0.1.12

type M struct {
	M map[string]interface{}
	// contains filtered or unexported fields
}

func (*M) Msg added in v0.1.12

func (t *M) Msg(format string, args ...interface{})

func (*M) Tag added in v0.1.12

func (t *M) Tag(tag string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL