Skip to content

Commit 043ee65

Browse files
nickhudkinskisielk
authored andcommitted
Update Walking Routes Section
Fixed invalid method chaining.
1 parent 59ce668 commit 043ee65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@ the following prints all of the registered routes:
326326
```go
327327
r := mux.NewRouter()
328328
r.HandleFunc("/", handler)
329-
r.Methods("POST").HandleFunc("/products", handler)
330-
r.Methods("GET").HandleFunc("/articles", handler)
331-
r.Methods("GET", "PUT").HandleFunc("/articles/{id}", handler)
329+
r.HandleFunc("/products", handler).Methods("POST")
330+
r.HandleFunc("/articles", handler).Methods("GET")
331+
r.HandleFunc("/articles/{id}", handler).Methods("GET", "PUT")
332332
r.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error {
333333
t, err := route.GetPathTemplate()
334334
if err != nil {

0 commit comments

Comments
 (0)