Replace call to deprecated ioutil.ReadAll with io.ReadAll

Starting from Go 1.16, ioutil.ReadAll simply calls io.ReadAll.
This commit is contained in:
jordi fita mas 2023-07-02 20:04:45 +02:00
parent eb845edf0a
commit f917ce84dd
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import (
"fmt" "fmt"
"github.com/jackc/pgtype" "github.com/jackc/pgtype"
"html/template" "html/template"
"io/ioutil" "io"
"net/http" "net/http"
"net/mail" "net/mail"
"net/url" "net/url"
@ -337,7 +337,7 @@ func (field *FileField) FillValue(r *http.Request) error {
return err return err
} }
defer file.Close() defer file.Close()
field.Content, err = ioutil.ReadAll(file) field.Content, err = io.ReadAll(file)
if err != nil { if err != nil {
return err return err
} }