diff --git a/README.md b/README.md index 0120cbc..63022a9 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ import ( ) func hello(c web.C, w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(w, "Hello, %s!", c.UrlParams["name"]) + fmt.Fprintf(w, "Hello, %s!", c.URLParams["name"]) } func main() { diff --git a/goji.go b/goji.go index 5b8a90d..55504d3 100644 --- a/goji.go +++ b/goji.go @@ -13,7 +13,7 @@ Example: ) func hello(c web.C, w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(w, "Hello, %s!", c.UrlParams["name"]) + fmt.Fprintf(w, "Hello, %s!", c.URLParams["name"]) } func main() { diff --git a/web/router.go b/web/router.go index 22cc1ca..e3805ff 100644 --- a/web/router.go +++ b/web/router.go @@ -78,7 +78,7 @@ type Pattern interface { // Returns true if the request satisfies the pattern. This function is // free to examine both the request and the context to make this // decision. After it is certain that the request matches, this function - // should mutate or create c.UrlParams if necessary, unless dryrun is + // should mutate or create c.URLParams if necessary, unless dryrun is // set. Match(r *http.Request, c *C, dryrun bool) bool } diff --git a/web/web.go b/web/web.go index b590d8b..8e49a9d 100644 --- a/web/web.go +++ b/web/web.go @@ -31,11 +31,11 @@ Use your favorite HTTP verbs: Bind parameters using either Sinatra-like patterns or regular expressions: m.Get("/hello/:name", func(c web.C, w http.ResponseWriter, r *http.Request) { - fmt.Fprintf(w, "Hello, %s!", c.UrlParams["name"]) + fmt.Fprintf(w, "Hello, %s!", c.URLParams["name"]) }) 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.Printf(w, "Info for IP address %s:", c.URLParams["ip"]) }) Middleware are functions that wrap http.Handlers, just like you'd use with raw @@ -84,7 +84,7 @@ layers and to the final request handler. As an implementation detail, references to these structs are reused between requests to reduce allocation churn, but the maps they contain are created fresh on every request. If you are closing over a context (especially relevant for -middleware), you should not close over either the UrlParams or Env objects, +middleware), you should not close over either the URLParams or Env objects, instead accessing them through the context whenever they are required. */ type C struct {