Compare commits

...

2 Commits

View File

@ -4,7 +4,6 @@ import (
"encoding/json"
"errors"
"fmt"
"net/http"
"strings"
)
@ -201,7 +200,6 @@ func (c *Client) ValidateColor(color Color) (Color, error) {
var (
err error
s *HSBKColor
r *http.Response
resp *Response
)
@ -209,13 +207,12 @@ func (c *Client) ValidateColor(color Color) (Color, error) {
return nil, err
}
resp, err = NewResponse(r)
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.IsError() {
return nil, resp.GetLifxError()
}
if err = json.NewDecoder(resp.Body).Decode(&s); err != nil {
return nil, err
}