diff options
author | Doug Black <dblack@twilio.com> | 2014-01-27 13:48:35 -0500 |
---|---|---|
committer | Doug Black <dblack@twilio.com> | 2014-01-27 13:48:35 -0500 |
commit | 3c972dfa8db0278106efa241693ac946e8cde757 (patch) | |
tree | a248637c504f6833822faa574db06ac0b58ede77 /core.go | |
parent | update docs (diff) | |
download | sleepy-3c972dfa8db0278106efa241693ac946e8cde757.tar.gz sleepy-3c972dfa8db0278106efa241693ac946e8cde757.tar.bz2 sleepy-3c972dfa8db0278106efa241693ac946e8cde757.zip |
more descriptive variable names
Diffstat (limited to 'core.go')
-rw-r--r-- | core.go | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -76,29 +76,29 @@ func (api *API) requestHandler(resource interface{}) http.HandlerFunc { switch method { case GET: - if r, ok := resource.(GetSupported); ok { - code, data = r.Get(values) + if resource, ok := resource.(GetSupported); ok { + code, data = resource.Get(values) } else { api.Abort(rw, 405) return } case POST: - if r, ok := resource.(PostSupported); ok { - code, data = r.Post(values) + if resource, ok := resource.(PostSupported); ok { + code, data = resource.Post(values) } else { api.Abort(rw, 405) return } case PUT: - if r, ok := resource.(PutSupported); ok { - code, data = r.Put(values) + if resource, ok := resource.(PutSupported); ok { + code, data = resource.Put(values) } else { api.Abort(rw, 405) return } case DELETE: - if r, ok := resource.(DeleteSupported); ok { - code, data = r.Delete(values) + if resource, ok := resource.(DeleteSupported); ok { + code, data = resource.Delete(values) } else { api.Abort(rw, 405) return |