From 043ee6597c29786140136a5747b6a886364f5282 Mon Sep 17 00:00:00 2001 From: Nick Hudkins Date: Tue, 23 May 2017 20:31:38 -0400 Subject: [PATCH] Update Walking Routes Section Fixed invalid method chaining. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d1d48b2..6fd4958 100644 --- a/README.md +++ b/README.md @@ -326,9 +326,9 @@ the following prints all of the registered routes: ```go r := mux.NewRouter() r.HandleFunc("/", handler) -r.Methods("POST").HandleFunc("/products", handler) -r.Methods("GET").HandleFunc("/articles", handler) -r.Methods("GET", "PUT").HandleFunc("/articles/{id}", handler) +r.HandleFunc("/products", handler).Methods("POST") +r.HandleFunc("/articles", handler).Methods("GET") +r.HandleFunc("/articles/{id}", handler).Methods("GET", "PUT") r.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error { t, err := route.GetPathTemplate() if err != nil {