Update Walking Routes Section
Fixed invalid method chaining.
This commit is contained in:
committed by
Kamil Kisiel
parent
59ce66852b
commit
043ee6597c
@@ -326,9 +326,9 @@ the following prints all of the registered routes:
|
|||||||
```go
|
```go
|
||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
r.HandleFunc("/", handler)
|
r.HandleFunc("/", handler)
|
||||||
r.Methods("POST").HandleFunc("/products", handler)
|
r.HandleFunc("/products", handler).Methods("POST")
|
||||||
r.Methods("GET").HandleFunc("/articles", handler)
|
r.HandleFunc("/articles", handler).Methods("GET")
|
||||||
r.Methods("GET", "PUT").HandleFunc("/articles/{id}", handler)
|
r.HandleFunc("/articles/{id}", handler).Methods("GET", "PUT")
|
||||||
r.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error {
|
r.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error {
|
||||||
t, err := route.GetPathTemplate()
|
t, err := route.GetPathTemplate()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user