3 ms·
People put way too much stuff in the context (whether that's the req.Context() or the gin.Context or whatever). It should only be for things that are request-sc
by morelisp 4y ago
People put way too much stuff in the context (whether that's the req.Context() or the gin.Context or whatever). It should only be for things that are request-scoped and need to cross middlewares that aren't aware of them. Most such middlewares (logging, metrics, last-ditch error handling) get put at the front of the chain anyway.
A circuit-breaker is basically by definition not request-scoped, so should not go in the context.