Documentation
¶
Overview ¶
Package source 提供与 go 源码相关的一些操作
Index ¶
- func CurrentDir() string
- func CurrentFile() string
- func CurrentFunction() string
- func CurrentLine() int
- func CurrentLocation() (path string, line int)
- func CurrentPath(path string) string
- func DumpGoSource(path string, content []byte) error
- func TraceStack(level int, msg ...interface{}) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentFunction ¶
func CurrentFunction() string
CurrentFunction 获取`调用者`所在的函数名
相当于部分语言的 __FUNCTION__
func CurrentLocation ¶ added in v0.1.2
CurrentLocation 获取调用者当前的位置信息
func TraceStack ¶
TraceStack 返回调用者的堆栈信息
level 表示调用者的级别,1 表示 TraceStack 自身,2 表示调用 TraceStack 的方法,以此类推; msg 表示需要输出的额外信息;
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.