Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
richardjennings committed May 27, 2023
1 parent 5c4d020 commit 828c60b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/tapo/tapo.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func NewTapo(ip string, email string, password string) (*Tapo, error) {
}

func (d *Tapo) encrypt(p map[string]interface{}) string {
in, err := json.Marshal(p)
in, _ := json.Marshal(p)

block, err := aes.NewCipher(d.key)
if err != nil {
Expand Down Expand Up @@ -129,6 +129,9 @@ func (d *Tapo) Handshake() error {
req.Header = map[string][]string{"Content-Type": {"application/json"}}
req.Close = true
res, err := d.client.Do(req)
if err != nil {
return err
}
defer res.Body.Close()

var v map[string]interface{}
Expand Down Expand Up @@ -157,7 +160,7 @@ func (d *Tapo) Request(url string, method string, body map[string]interface{}) (
if err := enc.Encode(body); err != nil {
return nil, err
}
req, err := http.NewRequest(method, url, buf)
req, _ := http.NewRequest(method, url, buf)
req.Header.Set("Cookie", d.sessionId)
req.Close = true

Expand Down

0 comments on commit 828c60b

Please sign in to comment.