chore (refactoring): replace ioutil with io - #847

This commit is contained in:
lemtea8
2025-06-18 08:07:11 +08:00
committed by GitHub
parent af7c4b911c
commit 9f2728c8b2
16 changed files with 40 additions and 49 deletions

View File

@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"
. "github.com/mickael-kerjean/filestash/server/common"
"io/ioutil"
"io"
"net/http"
"strings"
)
@ -12,7 +12,7 @@ import (
func BodyParser(fn HandlerFunc) HandlerFunc {
extractBody := func(req *http.Request) (map[string]interface{}, error) {
body := map[string]interface{}{}
byt, err := ioutil.ReadAll(req.Body)
byt, err := io.ReadAll(req.Body)
if err != nil {
return body, err
}