14 lines
267 B
Go
14 lines
267 B
Go
|
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()
|
||
|
}
|