chore: remove refs to deprecated io/ioutil

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
guoguangwu
2023-09-07 13:30:46 +08:00
committed by Alex Ellis
parent d0eec5fbbf
commit 4f4e3d288a

View File

@ -4,7 +4,6 @@ import (
"bytes"
"encoding/json"
"io"
"io/ioutil"
"net/http"
"github.com/openfaas/faas-provider/types"
@ -66,7 +65,7 @@ func MakeHorizontalScalingHandler(next http.HandlerFunc) http.HandlerFunc {
upstreamReq, _ := json.Marshal(scaleRequest)
// Restore the io.ReadCloser to its original state
r.Body = ioutil.NopCloser(bytes.NewBuffer(upstreamReq))
r.Body = io.NopCloser(bytes.NewBuffer(upstreamReq))
next.ServeHTTP(w, r)
}