Skip to content
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

why return a router for the methods strictslash, skipClean and use Encoded Path? #686

Open
prr123 opened this issue Jul 18, 2022 · 4 comments
Labels

Comments

@prr123
Copy link

prr123 commented Jul 18, 2022

Describe the problem you're having

A clear and concise description of what the bug is.
no bug, but an apparent redundant implementation
The methods already are linked to a pointer of Router, so there appears no need to return another pointer to the type Router.

Versions

Go version: go version

package version: run git rev-parse HEAD inside the repo

"Show me the code!"

A minimal code snippet can be useful, otherwise we're left guessing!
func (*r Router) SkipClean(value bool) *Router
Hint: wrap it with backticks to format it

@amustaque97
Copy link
Contributor

@prr123 As far as I know, mux is following the builder pattern here.

@prr123
Copy link
Author

prr123 commented Jul 19, 2022

Perhaps the reason is to allow daisy-chaining of methods?
i.e. the builder pattern allows for daisy-chaining of methods?

@amustaque97
Copy link
Contributor

Yes builder pattern will allow method chaining.

@ianling
Copy link

ianling commented Aug 9, 2022

This can be closed, unless OP feels the question has not been answered adequately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

3 participants