diff --git a/data_source.go b/data_source.go index a220056..6a4afe6 100644 --- a/data_source.go +++ b/data_source.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "mime/multipart" "net/http" "net/url" @@ -923,7 +922,7 @@ func (d FormData) FileBytes(field string) ([]byte, error) { return nil, err } - return ioutil.ReadAll(file) + return io.ReadAll(file) } // FileMimeType get File Mime Type name. eg "image/png" diff --git a/validate.go b/validate.go index d58aed1..1a1a98e 100644 --- a/validate.go +++ b/validate.go @@ -7,7 +7,7 @@ package validate import ( "encoding/json" - "io/ioutil" + "io" "net/http" "net/url" "reflect" @@ -380,7 +380,7 @@ func FromRequest(r *http.Request, maxMemoryLimit ...int64) (DataFace, error) { // JSON body request if jsonContent.MatchString(cType) { - bs, err := ioutil.ReadAll(r.Body) + bs, err := io.ReadAll(r.Body) if err != nil { return nil, err }