From b05cf0dd812acb3eda189a7584f5652ecc632d96 Mon Sep 17 00:00:00 2001 From: Collin Guarino Date: Sun, 31 Jan 2016 16:37:51 -0500 Subject: Refactored naming convention for http. --- light.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/light.go b/light.go index 70fc262..c1a560b 100644 --- a/light.go +++ b/light.go @@ -89,18 +89,18 @@ func GetAllLights(bridge *Bridge) ([]Light, error) { // and parse their values. Supports 100 lights. var lights []Light for index := 1; index < 101; index++ { - response, err := http.Get( + resp, err := http.Get( fmt.Sprintf("http://%s/api/%s/lights/%d", bridge.IPAddress, bridge.Username, index)) if err != nil { trace("", err) return lights, err - } else if response.StatusCode != 200 { - trace(fmt.Sprintf("Bridge status error %d", response.StatusCode), nil) + } else if resp.StatusCode != 200 { + trace(fmt.Sprintf("Bridge status error %d", resp.StatusCode), nil) } // Read the response - body, err := ioutil.ReadAll(response.Body) - defer response.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + defer resp.Body.Close() if err != nil { trace("", err) return lights, err -- cgit v1.2.3