package stack

import "github.com/mmcloughlin/avo/internal/stack"

Package stack provides helpers for querying the callstack.

Index

Functions

func ExternalCaller

func ExternalCaller() *runtime.Frame

ExternalCaller returns the first frame outside the callers package.

func Frames

func Frames(skip, max int) []runtime.Frame

Frames returns at most max callstack Frames, starting with its caller and skipping skip Frames.

func Main

func Main() *runtime.Frame

Main returns the main() function Frame.

func Match

func Match(skip int, predicate func(runtime.Frame) bool) *runtime.Frame

Match returns the first stack frame for which the predicate function returns true. Returns nil if no match is found. Starts matching after skip frames, starting with its caller.

Source Files

stack.go

Version
v0.6.0 (latest)
Published
Jan 7, 2024
Platform
windows/amd64
Imports
3 packages
Last checked
1 month ago

Tools for package owners.