refactor: move from io/ioutil to io and os packages (#5266)
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. [1]: https://golang.org/doc/go1.16#ioutil Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"io"
|
||||
|
||||
"github.com/emicklei/go-restful"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
@@ -131,7 +131,7 @@ func (h *handler) PatchResource(req *restful.Request, resp *restful.Response) {
|
||||
return
|
||||
}
|
||||
|
||||
data, err := ioutil.ReadAll(req.Request.Body)
|
||||
data, err := io.ReadAll(req.Request.Body)
|
||||
if err != nil {
|
||||
api.HandleBadRequest(resp, req, err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user