runs

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsError

func AsError(r interface{}) error

AsError returns r as error, converting it when necessary

func AsErrorString

func AsErrorString(r interface{}) string

AsErrorString returns error message, converting it when necessary

func PanicIfErr

func PanicIfErr(args ...interface{})

PanicIfErr throws a panic if any of the passed args is a non nil error

Types

type RuntimeFrame

type RuntimeFrame uintptr

RuntimeFrame represents a program counter inside a runtime stack frame.

func RuntimeCaller

func RuntimeCaller(skip int) (RuntimeFrame, bool)

RuntimeCaller returns a runtime stack frame for caller

func (RuntimeFrame) FileLine

func (f RuntimeFrame) FileLine() (string, int)

func (RuntimeFrame) Format

func (f RuntimeFrame) Format(s fmt.State, verb rune)

Format formats the frame according to the fmt.Formatter interface.

%v    github.com/subchen/go-stack/runs/runtime_stack:106
%+v   gstack.RuntimeCallers() (github.com/subchen/go-stack/runs/runtime_stack:106)

func (RuntimeFrame) Func

func (f RuntimeFrame) Func() *runtime.Func

func (RuntimeFrame) Name

func (f RuntimeFrame) Name() string

type RuntimeStack

type RuntimeStack []uintptr

RuntimeStack represents a runtime stack of program counters.

func RuntimeCallers

func RuntimeCallers(skip int) RuntimeStack

RuntimeCallers returns a runtime stack for callers

func (RuntimeStack) Format

func (stack RuntimeStack) Format(s fmt.State, verb rune)

Format formats the runtime stack according to the fmt.Formatter interface.

%v    at github.com/subchen/go-stack/runs/runtime_stack:106
      at example/main.go:9
      at example/main.go:16
%+v   at gstack.RuntimeCallers() (github.com/subchen/go-stack/runs/runtime_stack:106)
      at main.test() (example/main.go:9)
      at main.main() (example/main.go:16)

func (RuntimeStack) Frames

func (stack RuntimeStack) Frames() []RuntimeFrame

Frames returns runtime stack frames

Jump to

Keyboard shortcuts

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