tb

package
v2.1.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2017 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package tb exposes some handy traceback functionality buried in the runtime.

It can also be used to provide context to errors reducing the temptation to panic carelessly, just to get stack information.

The theory is that most errors that are created with the fmt.Errorf style are likely to be rare, but require more context to debug properly. The additional cost of computing a stack trace is therefore negligible.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(msg string, args ...interface{}) error

func Stack

func Stack(calldepth int) []byte

Stack is taken from runtime/debug.go calldepth is the number of (bottommost) frames to skip.

Types

type StackError

type StackError interface {
	Error() string
	StackTrace() string
}

StackError represents an error along with a stack trace.

Jump to

Keyboard shortcuts

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