Skip to content

Commit 546dd0c

Browse files
run go fmt with Go 1.20 (#725)
<!-- 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]>
1 parent 651928c commit 546dd0c

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

doc.go

+12-13
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ http.ServeMux, mux.Router matches incoming requests against a list of
1010
registered routes and calls a handler for the route that matches the URL
1111
or other conditions. The main features are:
1212
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.
2525
2626
Let's start registering a couple of URL paths and handlers:
2727
@@ -301,6 +301,5 @@ A more complex authentication middleware, which maps session token to users, cou
301301
r.Use(amw.Middleware)
302302
303303
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.
304-
305304
*/
306305
package mux

mux.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ func NewRouter() *Router {
3131
// It implements the http.Handler interface, so it can be registered to serve
3232
// requests:
3333
//
34-
// var router = mux.NewRouter()
34+
// var router = mux.NewRouter()
3535
//
36-
// func main() {
37-
// http.Handle("/", router)
38-
// }
36+
// func main() {
37+
// http.Handle("/", router)
38+
// }
3939
//
4040
// Or, for Google App Engine, register it in a init() function:
4141
//
42-
// func init() {
43-
// http.Handle("/", router)
44-
// }
42+
// func init() {
43+
// http.Handle("/", router)
44+
// }
4545
//
4646
// This will send all incoming requests to the router.
4747
type Router struct {

0 commit comments

Comments
 (0)