remove deprecated of package io/ioutil (#3395)

This commit is contained in:
Qt
2022-11-17 22:35:55 +08:00
committed by GitHub
parent 234a1d33f7
commit 6150c488e7
8 changed files with 27 additions and 31 deletions

View File

@ -7,7 +7,6 @@ package gin
import (
"errors"
"io"
"io/ioutil"
"log"
"math"
"mime/multipart"
@ -753,7 +752,7 @@ func (c *Context) ShouldBindBodyWith(obj any, bb binding.BindingBody) (err error
}
}
if body == nil {
body, err = ioutil.ReadAll(c.Request.Body)
body, err = io.ReadAll(c.Request.Body)
if err != nil {
return err
}
@ -872,7 +871,7 @@ func (c *Context) GetHeader(key string) string {
// GetRawData returns stream data.
func (c *Context) GetRawData() ([]byte, error) {
return ioutil.ReadAll(c.Request.Body)
return io.ReadAll(c.Request.Body)
}
// SetSameSite with cookie