Browse Source

Fix up URLParams rename compilation errors

This fixes up the last few compilation errors caused by the UrlParams =>
URLParams rename.
Carl Jackson 12 years ago
parent
commit
4cbff37537
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      default.go
  2. +2
    -2
      example/main.go

+ 1
- 1
default.go View File

@ -11,7 +11,7 @@ var DefaultMux *web.Mux
func init() {
DefaultMux = web.New()
DefaultMux.Use(middleware.RequestId)
DefaultMux.Use(middleware.RequestID)
DefaultMux.Use(middleware.Logger)
DefaultMux.Use(middleware.Recoverer)
DefaultMux.Use(middleware.AutomaticOptions)


+ 2
- 2
example/main.go View File

@ -99,7 +99,7 @@ func NewGreet(w http.ResponseWriter, r *http.Request) {
// GetUser finds a given user and her greets (GET "/user/:name")
func GetUser(c web.C, w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "Gritter\n======\n\n")
handle := c.UrlParams["name"]
handle := c.URLParams["name"]
user, ok := Users[handle]
if !ok {
http.Error(w, http.StatusText(404), 404)
@ -119,7 +119,7 @@ func GetUser(c web.C, w http.ResponseWriter, r *http.Request) {
// GetGreet finds a particular greet by ID (GET "/greet/\d+"). Does no bounds
// checking, so will probably panic.
func GetGreet(c web.C, w http.ResponseWriter, r *http.Request) {
id, err := strconv.Atoi(c.UrlParams["id"])
id, err := strconv.Atoi(c.URLParams["id"])
if err != nil {
http.Error(w, http.StatusText(404), 404)
return


Loading…
Cancel
Save