refactor: move from io/ioutil to io and os package (#2592)

This commit is contained in:
kekeimiku
2021-09-29 10:33:57 +08:00
committed by GitHub
parent 72a7fd948e
commit 0cee1877e3
19 changed files with 38 additions and 44 deletions

View File

@@ -19,7 +19,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"time"
@@ -162,7 +161,7 @@ func (monitor *Monitor) doHTTPCheck(ctx context.Context) error {
return err
}
defer resp.Body.Close()
io.Copy(ioutil.Discard, resp.Body)
io.Copy(io.Discard, resp.Body)
if resp.StatusCode/100 != 2 {
return fmt.Errorf("do http health check, StatusCode is [%d] not 2xx", resp.StatusCode)