Skip to content

Commit

Permalink
⬆️ chore(go): use the io.ReadAll instead of the ioutil.ReadAll
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Apr 7, 2023
1 parent 4d16ee9 commit e01fae9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"mime/multipart"
"net/http"
"net/url"
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package validate

import (
"encoding/json"
"io/ioutil"
"io"
"net/http"
"net/url"
"reflect"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit e01fae9

Please sign in to comment.