change: replace ioutil.ReadAll with io.ReadAll

This commit is contained in:
lilong.129
2023-08-29 17:27:54 +08:00
parent 97430bf451
commit b64fe9cfdd
6 changed files with 10 additions and 12 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"io"
"log"
"net/http"
"strings"
@@ -42,7 +42,7 @@ func parseBody(r *http.Request) (data map[string]interface{}, err error) {
// Always set resp.Data to the incoming request body, in case we don't know
// how to handle the content type
body, err := ioutil.ReadAll(r.Body)
body, err := io.ReadAll(r.Body)
if err != nil {
r.Body.Close()
return nil, err