Skip to content

Commit adc6184

Browse files
authored
chore(deprecations): migrate from ioutil to io (#299)
1 parent d19e730 commit adc6184

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/httputil/query.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"encoding/json"
66
"errors"
7-
"io/ioutil"
7+
"io"
88
"net/http"
99
"net/url"
1010
"reflect"
@@ -44,8 +44,8 @@ func GetURLFields(url *url.URL, filter any) []any {
4444
// be called before any of gin's c.*Bind methods.
4545
func GetBodyFields(c *gin.Context, resource any) ([]any, error) {
4646
// Copy the body to be able to use it multiple times
47-
body, _ := ioutil.ReadAll(c.Request.Body)
48-
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body))
47+
body, _ := io.ReadAll(c.Request.Body)
48+
c.Request.Body = io.NopCloser(bytes.NewBuffer(body))
4949

5050
// Parse the body into a map to have all fields available
5151
var mapBody map[string]any

0 commit comments

Comments
 (0)