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
<!--
For Work In Progress Pull Requests, please use the Draft PR feature,
see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for
further details.
For a timely review/response, please avoid force-pushing additional
commits if your PR already received reviews or comments.
Before submitting a Pull Request, please ensure that you have:
- 📖 Read the Contributing guide:
https://github.com/gorilla/.github/blob/main/CONTRIBUTING.md
- 📖 Read the Code of Conduct:
https://github.com/gorilla/.github/blob/main/CODE_OF_CONDUCT.md
- Provide tests for your changes.
- Use descriptive commit messages.
- Comment your code where appropriate.
- Squash your commits
- Update any related documentation.
- Add gorilla/pull-request-reviewers as a Reviewer
-->
## What type of PR is this? (check all applicable)
- [ ] Refactor
- [ ] Feature
- [ ] Bug Fix
- [ ] Optimization
- [x] Documentation Update
## Description
`go fmt` now formats godoc comments. I apply it.
## Related Tickets & Documents
<!--
For pull requests that relate or close an issue, please include them
below. We like to follow [Github's guidance on linking issues to pull
requests](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).
For example having the text: "closes #1234" would connect the current
pull
request to issue 1234. And when we merge the pull request, Github will
automatically close the issue.
-->
- Related Issue #
- Closes #
## Added/updated tests?
- [ ] Yes
- [x] No, and this is why: this pull request updates only comments
- [ ] I need help with writing tests
## Run verifications and test
- [x] `make verify` is passing
- [x] `make test` is passing
Co-authored-by: Corey Daley <[email protected]>
Copy file name to clipboardexpand all lines: doc.go
+12-13
Original file line number
Diff line number
Diff line change
@@ -10,18 +10,18 @@ http.ServeMux, mux.Router matches incoming requests against a list of
10
10
registered routes and calls a handler for the route that matches the URL
11
11
or other conditions. The main features are:
12
12
13
-
* Requests can be matched based on URL host, path, path prefix, schemes,
14
-
header and query values, HTTP methods or using custom matchers.
15
-
* URL hosts, paths and query values can have variables with an optional
16
-
regular expression.
17
-
* Registered URLs can be built, or "reversed", which helps maintaining
18
-
references to resources.
19
-
* Routes can be used as subrouters: nested routes are only tested if the
20
-
parent route matches. This is useful to define groups of routes that
21
-
share common conditions like a host, a path prefix or other repeated
22
-
attributes. As a bonus, this optimizes request matching.
23
-
* It implements the http.Handler interface so it is compatible with the
24
-
standard http.ServeMux.
13
+
- Requests can be matched based on URL host, path, path prefix, schemes,
14
+
header and query values, HTTP methods or using custom matchers.
15
+
- URL hosts, paths and query values can have variables with an optional
16
+
regular expression.
17
+
- Registered URLs can be built, or "reversed", which helps maintaining
18
+
references to resources.
19
+
- Routes can be used as subrouters: nested routes are only tested if the
20
+
parent route matches. This is useful to define groups of routes that
21
+
share common conditions like a host, a path prefix or other repeated
22
+
attributes. As a bonus, this optimizes request matching.
23
+
- It implements the http.Handler interface so it is compatible with the
24
+
standard http.ServeMux.
25
25
26
26
Let's start registering a couple of URL paths and handlers:
27
27
@@ -301,6 +301,5 @@ A more complex authentication middleware, which maps session token to users, cou
301
301
r.Use(amw.Middleware)
302
302
303
303
Note: The handler chain will be stopped if your middleware doesn't call `next.ServeHTTP()` with the corresponding parameters. This can be used to abort a request if the middleware writer wants to.
0 commit comments