Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompactTemplate ¶
CompactTemplate returns a single-line-per-frame representation template that emits concise goroutine information.
func FormatWithTemplate ¶
FormatWithTemplate renders a collection of goroutines using the supplied template. The template is executed once for each line that would appear in the textual stack trace: the goroutine header, each frame, and the optional creator frame. The provided TemplateData exposes the raw goroutine/frame values along with helper booleans that enable conditional formatting from the template itself.
func PanicTemplate ¶
PanicTemplate returns a template that mimics the formatting produced by a Go panic stack trace. The returned template is a clone of an internal instance, so callers may modify it without affecting future calls.
Types ¶
type Goroutine ¶
Goroutine represents a single goroutine.
type TemplateData ¶
type TemplateData struct {
Goroutine *Goroutine
Frame *Frame
GoroutineIndex int
GoroutineCount int
FrameIndex int
FrameCount int
IsHeader bool
IsFrame bool
IsCreator bool
IsFirstGoroutine bool
IsLastGoroutine bool
IsFirstFrame bool
IsLastFrame bool
HasFrames bool
HasCreator bool
HasOffset bool
OffsetHex string
}
TemplateData provides the context passed to templates executed by FormatWithTemplate. Fields are exported so they can be accessed from the template, including convenience booleans describing the position of the current line.