Skip to content

Commit

Permalink
Remove deprecated func (#24)
Browse files Browse the repository at this point in the history
Signed-off-by: JaySon-Huang <[email protected]>
  • Loading branch information
JaySon-Huang authored May 9, 2024
1 parent fb93fda commit c37ce2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"fmt"
"io/ioutil"
"io"
"net/http"
"strings"

Expand Down Expand Up @@ -97,7 +97,7 @@ func curlTiFlash(ip string, httpPort int, query string) error {
return err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/pd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package pd
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"strconv"
Expand Down Expand Up @@ -104,7 +104,7 @@ func (c *Client) GetRegionByKey(key tidb.TiKVKey) (Region, error) {
return region, err
}
defer resp.Body.Close()
bytes, err := ioutil.ReadAll(resp.Body)
bytes, err := io.ReadAll(resp.Body)
if err != nil {
return region, err
}
Expand All @@ -125,7 +125,7 @@ func (c *Client) GetNumRegionBetweenKey(startKey, endKey tidb.TiKVKey) (int64, e
return 0, err
}
defer resp.Body.Close()
bytes, err := ioutil.ReadAll(resp.Body)
bytes, err := io.ReadAll(resp.Body)
if err != nil {
return 0, err
}
Expand Down Expand Up @@ -160,7 +160,7 @@ func (c *Client) GetRegions(startKey tidb.TiKVKey, limit int64) ([]Region, error
return nil, err
}
defer resp.Body.Close()
bytes, err := ioutil.ReadAll(resp.Body)
bytes, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit c37ce2f

Please sign in to comment.