Documentation
¶
Overview ¶
Package utils 一些常用的函数集合。
Index ¶
- func CurrentDir() string
- func CurrentFile() string
- func CurrentFunction() string
- func CurrentLine() int
- func CurrentPath(path string) string
- func DumpGoFile(path, content string) error
- func DumpGoSource(path string, content []byte) error
- func FileExists(path string) bool
- func MD5(str string) string
- func Merge(deep bool, elems ...interface{}) error
- func Round(v float64) int64
- func SplitPath(path string) []string
- func TraceStack(level int, msg ...interface{}) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentFile ¶ added in v1.2.0
func CurrentFile() string
CurrentFile 获取`调用者`所在的文件
相当于部分语言的 __FILE__
func CurrentFunction ¶ added in v1.2.0
func CurrentFunction() string
CurrentFunction 获取`调用者`所在的函数名
相当于部分语言的 __FUNCTION__
func DumpGoSource ¶ added in v1.2.0
DumpGoSource 输出 Go 源码到 path
func TraceStack ¶
TraceStack 返回调用者的堆栈信息
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.