stack

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 5 Imported by: 0

README

stack

Go debug/stack utility functions.

Minify()

The stack.Minify() function accepts the output of debug.Stack() and returns a compact version that shows one stack entry per line. Function variables and offsets are removed so it only shows the package, function, filename, & line number.

stack.Minify(debug.Stack())
Input:

goroutine 61 [running]:
runtime/debug.Stack(0xd, 0xd, 0x4f44328)
	/usr/local/go/src/runtime/debug/stack.go:24 +0x9d
github.com/benbjohnson/stack/v2/foo.(*Bar).baz(0xc000c6a5b0, 0x4e00001, 0x0, 0x0, 0x0)
	/src/stack/benbjohnson/stack/foo.go:579 +0x7e
Output:

goroutine 61 [running]:
runtime/debug.Stack(): stack.go:24
github.com/benbjohnson/stack/v2/foo.(*Bar).baz(): foo.go:579

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Minify

func Minify(stack []byte) []byte

Minify returns a condensed version of debug.Stack().

Types

This section is empty.

Jump to

Keyboard shortcuts

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