Standard library / runtime

runtime.Frames.Next()

Returns the next resolved frame and whether additional frames remain. The last valid frame may have more=false. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func (ci *Frames) Next() (frame Frame, more bool)

Return Value

(frame Frame, more bool)

Next frame and whether there are further frames.

Working Example

Example Snippetgo
package main
import (  "fmt"  "runtime")
func main() {  pcs := make([]uintptr, 16)  n := runtime.Callers(1, pcs)  frames := runtime.CallersFrames(pcs[:n])  f, _ := frames.Next()  fmt.Println(f.Function != "")}
Go Reference