gin.Context or context.Context?

So here is what I am doing, I have all my functions/methods between all the Incoming and Outgoing requests as recommended. They are all of context.Context and I just pass in the gin.Context right now and it gets converted into a generic context.Context reference.

Right now I think this is the best compromise. It gets me “google best practices” and does not time me to Gin. Not that it really matters since using another framework would most likely be a complete re-write because they are all differently opinionated.

But then I have been reading not to put database connections and other “client” type references in Context.Value() for some very good reasons. So I am not really sure why I need it. So I guess I am ticking all the boxes AND not coupling my lower level layers to Gin or the Controller/Request/Response

1 Like