stack

package
v0.0.0-...-8675af2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2017 License: MIT Imports: 4 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxStackDepth = 50

MaxStackDepth is the maximum number of stackframes on any error.

Functions

This section is empty.

Types

type Frame

type Frame struct {
	File            string
	LineNumber      int
	Name            string
	Package         string
	IsSystemPackage bool
	ProgramCounter  uintptr
}

Frame contains all necessary information about to generate a line in a callstack.

func NewFrame

func NewFrame(pc uintptr) Frame

NewFrame popoulates a stack frame object from the program counter.

func (*Frame) Func

func (frame *Frame) Func() *runtime.Func

Func returns the function that this stackframe corresponds to

func (*Frame) String

func (frame *Frame) String() string

type Trace

type Trace struct {
	// contains filtered or unexported fields
}

func NewTrace

func NewTrace(skip int) *Trace

func (*Trace) Frames

func (t *Trace) Frames() []Frame

StackFrames returns an array of frames containing information about the stack.

func (*Trace) Stack

func (t *Trace) Stack() []byte

Stack returns a formatted callstack.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL