Skip to content

Commit

Permalink
Merge pull request #3184 from testwill/ioutil
Browse files Browse the repository at this point in the history
chore: remove refs to deprecated io/ioutil
  • Loading branch information
volcano-sh-bot authored Nov 13, 2023
2 parents 2c5c1f9 + eaf3b9f commit e72c9fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions example/extender/extender.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package main

import (
"encoding/json"
"io/ioutil"
"io"
"net/http"

"volcano.sh/volcano/pkg/scheduler/api"
Expand All @@ -28,7 +28,7 @@ import (
var snapshot *api.ClusterInfo

func onSessionOpen(w http.ResponseWriter, r *http.Request) {
content, err := ioutil.ReadAll(r.Body)
content, err := io.ReadAll(r.Body)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
Expand Down Expand Up @@ -56,7 +56,7 @@ func onSessionClose(w http.ResponseWriter, r *http.Request) {
}

func predicate(w http.ResponseWriter, r *http.Request) {
content, err := ioutil.ReadAll(r.Body)
content, err := io.ReadAll(r.Body)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
Expand Down Expand Up @@ -89,7 +89,7 @@ func predicate(w http.ResponseWriter, r *http.Request) {
}

func prioritize(w http.ResponseWriter, r *http.Request) {
content, err := ioutil.ReadAll(r.Body)
content, err := io.ReadAll(r.Body)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
Expand Down
3 changes: 1 addition & 2 deletions pkg/cli/job/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package job

import (
"encoding/json"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
Expand Down Expand Up @@ -50,7 +49,7 @@ func TestCreateJob(t *testing.T) {
if err != nil {
panic(err)
}
err = ioutil.WriteFile(fileName, val, os.ModePerm)
err = os.WriteFile(fileName, val, os.ModePerm)
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/scheduler/plugins/proportion/proportion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ limitations under the License.
package proportion

import (
"io/ioutil"
"io"
"net/http"
"reflect"
"strconv"
Expand Down Expand Up @@ -85,7 +85,7 @@ func getLocalMetrics() int {
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
body, err := io.ReadAll(res.Body)
if err != nil {
return data
}
Expand Down

0 comments on commit e72c9fb

Please sign in to comment.