Tagged in

Golang

Random Go tips
Random Go tips
Random Go tips
More information
Followers
502
Elsewhere
More, on Medium

On context.Context keys uniqueness

After reading the blog post introducing context.Context, I got used to using integers as context.Context keys.

Here is a code sample taken from the blog post :

// userIPkey is the context key for the user IP address…