Skip to content

Instantly share code, notes, and snippets.

@mhammonds
Last active August 29, 2015 14:26
Show Gist options
  • Save mhammonds/f9df2065576eda49f14d to your computer and use it in GitHub Desktop.
Save mhammonds/f9df2065576eda49f14d to your computer and use it in GitHub Desktop.
import "runtime"
// Generate a Stack Trace
buf := make([]byte, 1<<16)
runtime.Stack(buf, true)
n := bytes.Index(buf, []byte{0})
stackTrace := string(buf[:n])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment