Well, in general it’s a lot of boilerplate code.
Well, in general it’s a lot of boilerplate code. Keeping compatibility between (possible) conversion from/to other context.Context objects is a hassle, unless you make sure you can control how your code is being used.
On the other hand, once the API is clean enough, it’s much better than making those type assertions over and over.
I think if it’s a large enough project with a lot of people involved, I would now just create wrapper functions over context.Value, b/c explaining the design decision costs more than the cleverness.