-
Notifications
You must be signed in to change notification settings - Fork 69
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
Use chi.Router interface for AttachRoutes method #253
Labels
Comments
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/185332433 The labels on this github issue will be updated when the story is started. |
blgm
added a commit
that referenced
this issue
Jun 6, 2023
The chi.Router interface should be accepted rather than the *chi.Mux contete type. This allows for the contrete type to be substututed in accordance with the [Liskov substitution principle](https://en.wikipedia.org/wiki/Liskov_substitution_principle). Resolves #253
pivotal-marcela-campo
pushed a commit
that referenced
this issue
Jun 13, 2023
The chi.Router interface should be accepted rather than the *chi.Mux contete type. This allows for the contrete type to be substututed in accordance with the [Liskov substitution principle](https://en.wikipedia.org/wiki/Liskov_substitution_principle). Resolves #253
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
For some methods
chi
returns the interface type chi.Router, e.g. when using the Route method on *chi.Mux to create a subrouter.The AttachRoutes method currently uses the concrete implementation instead of the
chi.Router
interface, although it only relies on methods exposed bychi.Router
.Describe the solution you'd like
Changing the
AttachRoutes
method to accept thechi.Router
interface type, instead of*chi.Mux
would make it easier to use in some scenarios.Describe alternatives you've considered
Using a subrouter can still be achieved by creating a new router and mounting it manually, but methods such as
Route
orGroup
could only be used with type assertions.Additional context
No response
The text was updated successfully, but these errors were encountered: