Skip to content

Commit 0a08502

Browse files
committed
ioutil.Discard is deprecated
1 parent eec4eba commit 0a08502

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

switchbot.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"errors"
1111
"fmt"
1212
"io"
13-
"io/ioutil"
1413
"log"
1514
"net/http"
1615
"net/http/httputil"
@@ -193,7 +192,7 @@ func (resp *httpResponse) DecodeJSON(data interface{}) error {
193192
}
194193

195194
func (resp *httpResponse) Close() {
196-
_, _ = io.Copy(ioutil.Discard, resp.Body)
195+
_, _ = io.Copy(io.Discard, resp.Body)
197196
_ = resp.Body.Close()
198197
}
199198

0 commit comments

Comments
 (0)