From ad8315668ea6a92cb25dd7e16233c1f3f2c1a6dc Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sat, 29 Feb 2020 00:43:32 -0600 Subject: [PATCH] change token variable names --- client.go | 8 ++++---- structs.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client.go b/client.go index 51c837c..d492acb 100644 --- a/client.go +++ b/client.go @@ -24,13 +24,13 @@ var errorMap = map[int]error{ 523: errors.New("Something went wrong on LIFX's end"), } -func NewClient(token string) *Client { +func NewClient(accessToken string) *Client { tr := &http.Transport{ //TLSNextProto: make(map[string]func(authority string, c *tls.Conn) http.RoundTripper), } return &Client{ - token: token, - Client: &http.Client{Transport: tr}, + accessToken: accessToken, + Client: &http.Client{Transport: tr}, } } @@ -39,7 +39,7 @@ func (s *Client) NewRequest(method, url string, body io.Reader) (req *http.Reque if err != nil { return } - req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", s.token)) + req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", s.accessToken)) return } diff --git a/structs.go b/structs.go index 4e414b1..f821b1b 100644 --- a/structs.go +++ b/structs.go @@ -29,8 +29,8 @@ type ( } Client struct { - token string - Client *http.Client + accessToken string + Client *http.Client } Results struct {