MCPcopy Create free account
hub / github.com/maruel/panicparse / GoroutineHeader

Method GoroutineHeader

internal/ui.go:181–204  ·  view source on GitHub ↗

GoroutineHeader prints the header of a goroutine.

(g *stack.Goroutine, pf pathFormat, multipleGoroutines bool)

Source from the content-addressed store, hash-verified

179
180// GoroutineHeader prints the header of a goroutine.
181func (p *Palette) GoroutineHeader(g *stack.Goroutine, pf pathFormat, multipleGoroutines bool) string {
182 extra := ""
183 if s := g.SleepString(); s != "" {
184 extra += " [" + s + "]"
185 }
186 if g.Locked {
187 extra += " [locked]"
188 }
189 if c := pf.createdByString(&g.Signature); c != "" {
190 extra += p.CreatedBy + " [Created by " + c + "]"
191 }
192 if g.RaceAddr != 0 {
193 r := "read"
194 if g.RaceWrite {
195 r = "write"
196 }
197 extra += fmt.Sprintf("%s%s Race %s @ 0x%08x", p.EOLReset, p.Race, r, g.RaceAddr)
198 }
199 return fmt.Sprintf(
200 "%s%d: %s%s%s\n",
201 p.routineColor(g.First, multipleGoroutines), g.ID,
202 g.State, extra,
203 p.EOLReset)
204}
205
206// callLine prints one stack line.
207func (p *Palette) callLine(line *stack.Call, srcLen, pkgLen int, pf pathFormat) string {

Callers 1

writeGoroutinesToConsoleFunction · 0.80

Calls 3

routineColorMethod · 0.95
SleepStringMethod · 0.80
createdByStringMethod · 0.80

Tested by

no test coverage detected