You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mux.NewRouter() returns *mux.Router but HeadersRegexp is defined on *Route. This is a small mistake and is not a major issue because the next (more verbose) example clarifies the mistake.
Fixes#666
**Summary of Changes**
1. Update `Route` method documentation comments where the example in the
comments showed a `Router` before. Updated method names include:
* `Headers`
* `HeadersRegexp`
* `Host`
* `Path`
* `Queries`
* `Subrouter`
* `URL`
Notes:
* This includes what PR #667 did plus some changes requested by a
maintainer in the comments
* I was a little torn about changing the example in `Subrouter` since
`(*Router).Host()` (like several `(*Router)` methods) just calls
`(*Router).NewRoute().Host()` so I understand if maintainers are
ambivalent about that example or want it to remain the same.
Signed-off-by: Corey Daley <[email protected]>
Co-authored-by: Andrew Brown <[email protected]>
Co-authored-by: Corey Daley <[email protected]>
Describe the bug
The documentation example for
func (*Route) HeadersRegexp
is incorrect:mux.NewRouter()
returns*mux.Router
butHeadersRegexp
is defined on*Route
. This is a small mistake and is not a major issue because the next (more verbose) example clarifies the mistake.However, it's a mistake.
Should be something like:
Versions
Steps to Reproduce
"Bug" is in documentation; triggered by looking at it.
Expected behavior
As mentioned above, the example should look like:
The text was updated successfully, but these errors were encountered: