Documentation ¶
Overview ¶
Package goid provides goid.GoID(), unique goroutine identifiers
m := map[goid.ThreadID]SomeInterface{} m[goid.GoID()] = …
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseFirstStackLine ¶
func ParseFirstStackLine(stackTrace string, onlyID bool) (ID ThreadID, status ThreadStatus, err error)
getID obtains gorutine ID, as of go1.18 a numeric string "1"…
Types ¶
type Frame ¶
type Frame struct { pruntime.CodeLocation // args like "(1, 2, 3)" Args string }
type Stack ¶
type Stack struct { // ThreadID is a unqique ID associated with this thread. // typically numeric string “1”… // it can be used as a map key or converted to string ID ThreadID // Status is typically word “running” Status ThreadStatus // IsMainThread indicates if this is the thread that launched main.main IsMainThread bool // Frames is a list of code locations for this thread. // [0] is the invoker of goid.NewStack(). // last is the function starting this thread. // Frame.Args is invocation values like "(0x14000113040)". Frames []Frame // Creator is the code location of the go statement launching // this thread. // FuncName is "main.main()" for main thread Creator pruntime.CodeLocation }
type ThreadID ¶
type ThreadID string
ThreadID is an opaque type that uniquley identifies a thread, ie. a goroutine. pruntime.GoRoutineID obtains the ThreadID for the executing thread. ThreadID is comparable, ie. can be used as a map key. ThreadID can be cast to string
type ThreadStatus ¶
type ThreadStatus string
ThreadStatus indicates the current stat of a thread most often it is "running"
Click to show internal directories.
Click to hide internal directories.