-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Export Handlers (req, resp, https) #445
base: master
Are you sure you want to change the base?
Conversation
This is usufull when handlers will be dynamicaly created and removed.
Can you please explain why you can't use the existing methods to manipulate the handlers? Making a private field public is risky, as it cannot be undone. |
@elazarl in current implementation, Handlers are manipulated by What I need is to Add / List and Remove handlers to be able to do it dynamically (at run-time). |
This permit to update content without edgecases Signed-off-by: Guilhem Lettron <[email protected]>
I don't see why you need indirection. Making them public should be good enough. Slice is already a pointer. Also not sure how you handle concurrency. |
I totally agree with you. I also find this article, not sure if applicable: https://medium.com/swlh/golang-tips-why-pointers-to-slices-are-useful-and-how-ignoring-them-can-lead-to-tricky-bugs-cac90f72e77b |
@elazarl I did more tests and slice is not updated if it's not a pointer. |
@guilhem what I suggest is, add a single handler that has internal handlers, and handle concurrency inside We'll add this as an extension. What do you think? |
I will try to do this solution :) |
This is usufull when handlers will be dynamicaly created and removed.