-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Abstract Router interface for App and Group. #476
Conversation
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.
Could you fix the error thrown by the tests? Thanks!
All tests passed on my machine before I created the pull request. I don’t know why it failed in the CI. |
##[error]./app.go:31:16: cannot use &(App literal) (value of type *App) as Router value in variable declaration: wrong type for method Add
##[error]./group.go:13:16: cannot use &(Group literal) (value of type *Group) as Router value in variable declaration: wrong type for method Add If you could add a test case that would be great 👍 |
Sorry for using wrong way to ensure App and Group implement Router interface. I’ll add a test case for this. |
Why do you add an interface that's be not using? type Router interface{
Get()
}
type Routing struct {
Router
} |
@renanbastos93 This Router interface is for users who use fiber with sub-router. e.g.
The |
Router interface defines all router handle interface includes app and group router.When dealing with sub-routers, users do not need to care about the specific implementation.