Documentation ¶
Index ¶
- func Assert(b bool, fmts ...interface{})
- func AssertFunc(target interface{})
- func AssertPtr(ptr interface{})
- func CheckFuncArgs(a, b reflect.Type, shiftA, shiftB int) bool
- func CheckReturnType(fn interface{}, results ...interface{})
- func DebugPrintf(format string, a ...interface{})
- func GetGoroutineID() int64
- func IsDebug() bool
- func IsGCFlagsSet() bool
- func ReflectCall(f reflect.Value, args []reflect.Value) []reflect.Value
- func SetDebugMode()
- type CallerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertFunc ¶
func AssertFunc(target interface{})
func CheckReturnType ¶
func CheckReturnType(fn interface{}, results ...interface{})
func DebugPrintf ¶
func DebugPrintf(format string, a ...interface{})
func GetGoroutineID ¶
func GetGoroutineID() int64
func IsGCFlagsSet ¶ added in v1.2.7
func IsGCFlagsSet() bool
func SetDebugMode ¶
func SetDebugMode()
Types ¶
type CallerInfo ¶ added in v1.1.0
func Caller ¶ added in v1.1.0
func Caller() CallerInfo
func OuterCaller ¶ added in v1.1.0
func OuterCaller() (info CallerInfo)
Caller gets non-current package caller of a function For example, assume we have 3 files: a/b/foo.go, a/c/bar.go and a/c/innerBar.go, a/b/foo.Foo calls a/c/bar.Bar, and a/c/bar.Bar calls a/c/innerBar.innerBar. Here is how innerBar looks like:
func innerBar() CallerInfo { /*do some thing*/ return Caller() }
The return value of innerBar should represent the line in a/b/foo.go where a/b/foo.Foo calls a/c/bar.Bar
func (CallerInfo) String ¶ added in v1.1.0
func (c CallerInfo) String() string
Click to show internal directories.
Click to hide internal directories.