aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Black <dblack@twilio.com>2014-01-27 13:48:35 -0500
committerDoug Black <dblack@twilio.com>2014-01-27 13:48:35 -0500
commit3c972dfa8db0278106efa241693ac946e8cde757 (patch)
treea248637c504f6833822faa574db06ac0b58ede77
parentupdate docs (diff)
downloadsleepy-3c972dfa8db0278106efa241693ac946e8cde757.tar.gz
sleepy-3c972dfa8db0278106efa241693ac946e8cde757.tar.bz2
sleepy-3c972dfa8db0278106efa241693ac946e8cde757.zip
more descriptive variable names
-rw-r--r--core.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/core.go b/core.go
index 5613522..463c11c 100644
--- a/core.go
+++ b/core.go
@@ -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
bgstack15