Tagged in

Programming

Random Go tips
Random Go tips
Random Go tips
More information
Followers
503
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…