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

Documentation for router.Lookup out of date #54

Closed
MarkArts opened this issue Sep 6, 2021 · 2 comments
Closed

Documentation for router.Lookup out of date #54

MarkArts opened this issue Sep 6, 2021 · 2 comments

Comments

@MarkArts
Copy link
Contributor

MarkArts commented Sep 6, 2021

// Lookup allows the manual lookup of a method + path combo.

The documentation for the function router.Lookup mentions a third parameter and doesn't match the actual function body:

// Lookup allows the manual lookup of a method + path combo.
// This is e.g. useful to build a framework around this router.
// If the path was found, it returns the handler function and the path parameter
// values. Otherwise the third return value indicates whether a redirection to
// the same path with an extra / without the trailing slash should be performed.

I guess it should be:

// Lookup allows the manual lookup of a method + path combo.
// This is e.g. useful to build a framework around this router.
// If the path was found, it returns the handler function. Otherwise the second return value indicates whether a redirection to
// the same path with an extra / without the trailing slash should be performed.

It also doesn't metion what the ctx value is used for when looking up a handler and i can't really figure out why the ctx is needed here

@savsgio
Copy link
Member

savsgio commented Sep 7, 2021

Hi @MarkArts,

Could you make a PR? please.

MarkArts added a commit to MarkArts/router that referenced this issue Oct 10, 2021
@MarkArts
Copy link
Contributor Author

Not very active on github and forgot about the issue but here it is:
#55

savsgio pushed a commit that referenced this issue Oct 11, 2021
* Update router.go Lookup documentation

#54

* Remove trailing whitespace from documentation
@savsgio savsgio closed this as completed Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants