observer/pkg/code_location/code_location.go

14 lines
267 B
Go
Raw Normal View History

package code_location
type CodeLocation struct {
FilePath string
FuncName string
LineNumber int
ColumnNumber int
}
func FromStackTrace(...atDepth int) {
pc, file, line, _ := runtime.Caller(1 + skipLevelsInCallStack)
funcName := runtime.FuncForPC(pc).Name()
}