From 3ed309536a3803bfb05ffef7e8c22f82832b815d Mon Sep 17 00:00:00 2001 From: Ankit Patial Date: Sat, 12 Oct 2024 19:40:54 +0530 Subject: [PATCH] make it more readable --- example/main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/example/main.go b/example/main.go index 3843a64..ce97501 100644 --- a/example/main.go +++ b/example/main.go @@ -25,7 +25,7 @@ func main() { // let's add a route r.Get("/hello", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("hello1")) + w.Write([]byte("i am route /hello")) }) // r.Post(pattern string, h http.HandlerFunc) // r.Put(pattern string, h http.HandlerFunc) @@ -34,8 +34,8 @@ func main() { // you can inline middleware(s) to a route r. With(mwInline). - Get("/test", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("middle ware 3 test")) + Get("/hello-2", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("i am route /hello-2 with my own middleware")) }) // you define a resource @@ -50,18 +50,18 @@ func main() { // PATCH /photos/:id // DELETE /photos/:id resource.Index(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("user index")) + w.Write([]byte("all photos")) }) resource.New(func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("create new user")) + w.Write([]byte("upload a new pohoto")) }) }) r.Group(func(grp *mux.Router) { grp.Use(mwGroup) grp.Get("/group", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("i am group 1")) + w.Write([]byte("i am route /group")) }) })