-
-
Notifications
You must be signed in to change notification settings - Fork 954
feat(std-http): accept Mux
interface instead of *http.ServeMux
#1720
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
Conversation
@@ -3,21 +3,27 @@ func Handler(si ServerInterface) http.Handler { | |||
return HandlerWithOptions(si, StdHTTPServerOptions{}) | |||
} | |||
|
|||
// ServeMux is an abstraction of http.ServeMux. | |||
type ServeMux interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be exported? Probably no big deal it is, but thought I'd ask
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s good since you use it in the method’s arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! 1 comment then
Mux
interface instead of *http.ServeMux
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Description
As described on Issue #1718, I'm implementing receiving Mux as interface instead of *http.ServeMux.
Following the open-closed principle, it will allow the library to be more customizable for the developers.