From b504b24726cda31bf72b8385552426bac826eda1 Mon Sep 17 00:00:00 2001 From: saj1th Date: Tue, 17 Jun 2014 17:02:51 +0530 Subject: [PATCH] Fix typo Typo in examples --- web/web.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/web.go b/web/web.go index 8e49a9d..9ddc9f9 100644 --- a/web/web.go +++ b/web/web.go @@ -25,7 +25,7 @@ Use your favorite HTTP verbs: var legacyFooHttpHandler http.Handler // From elsewhere m.Get("/foo", legacyFooHttpHandler) m.Post("/bar", func(w http.ResponseWriter, r *http.Request) { - w.Write("Hello world!") + w.Write([]byte("Hello world!")) }) Bind parameters using either Sinatra-like patterns or regular expressions: @@ -35,7 +35,7 @@ Bind parameters using either Sinatra-like patterns or regular expressions: }) pattern := regexp.MustCompile(`^/ip/(?P(?:\d{1,3}\.){3}\d{1,3})$`) m.Get(pattern, func(c web.C, w http.ResponseWriter, r *http.Request) { - fmt.Printf(w, "Info for IP address %s:", c.URLParams["ip"]) + fmt.Fprintf(w, "Info for IP address %s:", c.URLParams["ip"]) }) Middleware are functions that wrap http.Handlers, just like you'd use with raw