Back to

Package goroutine

Latest Go to latest

The latest major version is .

Published: Aug 1, 2020 | License: Apache-2.0 | Module:


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


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: sponaneous combustion, incurable insanity, and rapid acute cardiac lithomophosis (RACL).

That said, it turns out that this functionality is very important for implemening 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...).

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier