Tips and Tricks
Using gorilla/context
for request-specific data
It is pretty often that we need to store and retrieve data that is specific to
the current HTTP request. Use gorilla/context
to map values and retrieve them
later. It contains a global mutex on a map of request objects.
val := context.Get(r, "myKey")
// ...
}