gin icon indicating copy to clipboard operation
gin copied to clipboard

How to get engine from *gin.Context?

Open tfreedy opened this issue 6 months ago • 2 comments

Hi,

Is there a way to get engine from the Context? I have some middleware where I want to call HandleContext to do a redirect.

-Tomas

tfreedy avatar Jun 10 '25 17:06 tfreedy

Hi, I guess you can only store a reference to it in the Context if you want to access it from there. As an alternative, you can use a global variable.

eqsdxr avatar Jun 11 '25 01:06 eqsdxr

Can I get some background on this? I don't think this is a good solution. maybe a xy problem?

FarmerChillax avatar Jun 25 '25 10:06 FarmerChillax