Documentation
¶
Overview ¶
包gdebug包含程序在运行时进行自我调试的设施。 md5:c0f5e17b30ee5fbc
Index ¶
- func BinVersion() string
- func BinVersionMd5() string
- func Caller(skip ...int) (function string, path string, line int)
- func CallerDirectory() string
- func CallerFileLine() string
- func CallerFileLineShort() string
- func CallerFilePath() string
- func CallerFunction() string
- func CallerPackage() string
- func CallerWithFilter(filters []string, skip ...int) (function string, path string, line int)
- func FuncName(f interface{}) string
- func FuncPath(f interface{}) string
- func GoroutineId() int
- func PrintStack(skip ...int)
- func Stack(skip ...int) string
- func StackWithFilter(filters []string, skip ...int) string
- func StackWithFilters(filters []string, skip ...int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinVersion ¶
func BinVersion() string
BinVersion 返回当前运行二进制文件的版本。 它使用ghash.BKDRHash和BASE36算法来计算二进制文件的独特版本。 md5:d61ca269b0c85c70
func BinVersionMd5 ¶
func BinVersionMd5() string
BinVersionMd5 返回当前运行二进制文件的版本。 它使用MD5算法计算二进制文件的独特版本。 md5:e716b98ad45cf095
func CallerFileLine ¶
func CallerFileLine() string
CallerFileLine 返回调用者的文件路径和行号。 md5:94cba50c9cbd0bd5
func CallerFileLineShort ¶
func CallerFileLineShort() string
CallerFileLineShort 返回调用者所在的文件名和行号。 md5:ca795c06dfcf9d18
func CallerWithFilter ¶
CallerWithFilter 返回调用者函数名、绝对文件路径及其行号。
参数 `filters` 用于过滤调用者的路径。 md5:77e7b623dc180797
func GoroutineId ¶
func GoroutineId() int
GoroutineId 从堆栈信息中获取并返回当前goroutine的ID。 需要特别注意的是,由于它使用了runtime.Stack函数,因此性能较低。 通常用于调试目的。 md5:c6453659dbcae88d
func StackWithFilter ¶
StackWithFilter 返回调用它的goroutine的格式化堆栈跟踪。 它使用足够大的缓冲区调用runtime.Stack以捕获整个跟踪。
参数`filter`用于过滤调用者路径。 md5:5342cfca7c1801ab
func StackWithFilters ¶
StackWithFilters 返回调用它的goroutine的格式化堆栈跟踪。 它使用足够大的缓冲区调用runtime.Stack以捕获整个跟踪。
参数 `filters` 是一个字符串切片,用于过滤调用者的路径。
待办:使用debug.Stack来提高性能。 md5:febf8524b3fa5e97
Types ¶
This section is empty.