From 3c972dfa8db0278106efa241693ac946e8cde757 Mon Sep 17 00:00:00 2001 From: Doug Black Date: Mon, 27 Jan 2014 13:48:35 -0500 Subject: more descriptive variable names --- core.go | 16 ++++++++-------- 1 file 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 -- cgit