Return a struct from gin's RegisterHandlers instead of an interface - #555
Return a struct from gin's RegisterHandlers instead of an interface#555jazware wants to merge 2 commits into
gin's RegisterHandlers instead of an interface#555Conversation
|
I included autogeneration of new examples via |
|
Hi! Sorry to nudge you like this, but could you provide any estimate on when this is going to be merged? #485 poses major discrepancy when using this generator. I can see a solution had already been implemented in the past, but got reverted later due to inconsistencies with usage examples. If that's the only issue, would it be much of a trouble for you to align the documentation to match the actual API? Afaik this project had some breaking changes in the release a week or two ago, perhaps now it's a good time to carry this change out. |
|
Thank you for submitting this PR, @jazware — but we need to close it. Goal (1) — accepting Apologies for the long wait, and thanks for the contribution. |
This change provides an alternative to #554 based on the discussions in #530.
For setting up a Gin engine, we want to handle the
IRouterinterface when registering handlers, but as this only thinly wraps a*gin.GroupRouter, we can return a*gin.GroupRouterfrom the registration function.We could refactor the
RegisterHandlersandRegisterHandlersWithOptionsto just take a*gin.GroupRouterto begin with, I'm not really sure what we gain by using theIRouterinterface here. Does anyone have opinions on doing that?