Standard library / runtime
runtime.Frame
Describes a symbolic call frame including function, file and line. Some fields may be absent. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
type Frame struct { PC uintptr
Func *Func
Function string
File string Line int
Entry uintptr
}Working Example
Example Snippetgo
package main
import ( "fmt" "runtime")
func main() { pcs := make([]uintptr, 16) n := runtime.Callers(1, pcs) var f runtime.Frame f, _ = runtime.CallersFrames(pcs[:n]).Next() fmt.Println(f.Function != "")}