diff options
author | Franck Cuny <franck@lumberjaph.net> | 2013-04-21 16:38:11 -0700 |
---|---|---|
committer | Franck Cuny <franck@lumberjaph.net> | 2013-04-21 16:38:11 -0700 |
commit | 1fadb46a69a21cbac98ee11b4575b2b563f98394 (patch) | |
tree | 43969515a25ad5337959dcfa3b72e983ec014bc0 /mooh.go | |
parent | Normalize the name of captured components. (diff) | |
download | path-router-1fadb46a69a21cbac98ee11b4575b2b563f98394.tar.gz |
Add a constructor to create the Request object.
Some logic will be needed to create this object, it's easier to do that with a constructor.
Diffstat (limited to 'mooh.go')
-rw-r--r-- | mooh.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/mooh.go b/mooh.go index 465caf5..a8858a6 100644 --- a/mooh.go +++ b/mooh.go @@ -19,12 +19,9 @@ func (self *Dispatcher) ServeHTTP(resp http.ResponseWriter, req *http.Request) { return } - request := Request{ - match.Mapping, - req, - } + request := NewRequest(req, match) - nresp, error := match.Route.Execute(&request) + nresp, error := match.Route.Execute(request) if error == nil { fmt.Fprint(resp, nresp.Content) |