Package goroutine is mostly to house a function for obtaining the current goroutine ID, but probably will eventually contain other naughty functions.



This section is empty.


This section is empty.


This section is empty.


type ID

type ID uint64

ID is the ID number of a goroutine.

func CurID

func CurID() ID

CurID gets the ID number of the current goroutine.

According to the Go Authors, using this number will cause, among other things: spontaneous combustion, incurable insanity, and rapid acute cardiac lithomophosis (RACL).

That said, it turns out that this functionality is very important for implementing things such as the errors.Annotate functionality.

If, at some point, the Go Authors deign to provide this functionality via the runtime package, this method and type will be deleted immediately in favor of that.

(if you are a Go Author, please, please, PLEASE provide this as part of the stdlib...).