Skip to content

Commit

Permalink
Resolve deprecation warnings.
Browse files Browse the repository at this point in the history
Signed-off-by: Omar Pakker <[email protected]>
  • Loading branch information
Omar007 committed Oct 2, 2024
1 parent 66ce57e commit c1ef6e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/cubefs/cfs_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
"strconv"
Expand Down Expand Up @@ -120,7 +120,7 @@ func (cs *cfsServer) persistClientConf(mountPoint string) error {
cs.clientConf[KProfPort] = strconv.Itoa(profPort)
_ = os.Mkdir(cs.clientConf[KLogDir], 0777)
clientConfBytes, _ := json.Marshal(cs.clientConf)
err := ioutil.WriteFile(cs.clientConfFile, clientConfBytes, 0444)
err := os.WriteFile(cs.clientConfFile, clientConfBytes, 0444)
if err != nil {
return status.Errorf(codes.Internal, "create client config file fail. err: %v", err.Error())
}
Expand Down Expand Up @@ -211,7 +211,7 @@ func (cs *cfsServer) executeRequest(url string) (*cfsServerResponse, error) {
}

defer httpResp.Body.Close()
body, err := ioutil.ReadAll(httpResp.Body)
body, err := io.ReadAll(httpResp.Body)
if err != nil {
return nil, status.Errorf(codes.Unavailable, "read http response body, url(%v) bodyLen(%v) err(%v)", url, len(body), err)
}
Expand Down

0 comments on commit c1ef6e0

Please sign in to comment.