package main
import ("fmt";"runtime")
golang 的runtime库,提供Caller函数,可以返回运行时正在执行的文件名和行号:
函数定义:
func Caller(skip int) (pc uintptr, file string, line int, ok bool
package main
import ("fmt";"runtime")
golang 的runtime库,提供Caller函数,可以返回运行时正在执行的文件名和行号:
函数定义:
func Caller(skip int) (pc uintptr, file string, line int, ok bool