Documentation ¶
Overview ¶
Package goid obtaines a thread’s parl.ThreadID unique goroutine identifier.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GoID ¶
GoID obtains a numeric string that as of Go1.18 is assigned to each goroutine
- goid 64-bit integer number incremented from 1 for the main invocation thread
- cache this value, it is expensive at 1.7 parallel mutex Lock/Unlock via pruntime.FirstStackLine
Usage:
m := map[goid.ThreadID]SomeInterface{} cachedGoID := goid.GoID() m[cachedGoID] = …
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.