A Go Transgression


Go gives the programmer introspection into every aspect of the language, and of a running program. But to one thing the programmer does not have access, and it is the goroutine identifier. Because the day the programmers know the goroutine identifier, they create goroutine-local storage through shared access and mutexes, and shall surely die.

In Infergo, I had to have goroutine-local storage. Here is how I got efficient goroutine-local storage in Go.