luci: go.chromium.org/luci/common/runtime/goroutine Index | Files

package goroutine

import "go.chromium.org/luci/common/runtime/goroutine"

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

Index

Package Files

doc.go goroutine_id.go

type ID Uses

type ID uint64

ID is the ID number of a goroutine.

func CurID Uses

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 goroutine imports 6 packages (graph) and is imported by 2 packages. Updated 2018-12-14. Refresh now. Tools for package owners.