diff options
author | Collin Guarino <collin.guarino@gmail.com> | 2016-01-31 16:37:51 -0500 |
---|---|---|
committer | Collin Guarino <collin.guarino@gmail.com> | 2016-01-31 16:37:51 -0500 |
commit | b05cf0dd812acb3eda189a7584f5652ecc632d96 (patch) | |
tree | 27f6c122705c65d049ab587a4588399ab1d22add | |
parent | 80a4f4ab1a92c687241043ddedab291a67257150 (diff) |
Refactored naming convention for http.
-rw-r--r-- | light.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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 |