diff options
author | Zachary Walters <zachary.christopher.walters@gmail.com> | 2023-02-03 23:43:36 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-04 13:43:36 +0800 |
commit | 5887bc116f00062e3e9c0dcc7cc8eca84f5160ac (patch) | |
tree | f3ecbfdb9a084821d1b524ce020f46378d416e71 /internal/route/lfs | |
parent | 6d220540c15e68196404951e8b67cac8002d1a6f (diff) |
chore: remove usages of the deprecated `ioutil` (#7332)
Co-authored-by: Joe Chen <jc@unknwon.io>
Diffstat (limited to 'internal/route/lfs')
-rw-r--r-- | internal/route/lfs/basic.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/route/lfs/basic.go b/internal/route/lfs/basic.go index cbfc724f..0006f174 100644 --- a/internal/route/lfs/basic.go +++ b/internal/route/lfs/basic.go @@ -7,7 +7,6 @@ package lfs import ( "encoding/json" "io" - "io/ioutil" "net/http" "strconv" @@ -82,7 +81,7 @@ func (h *basicHandler) serveUpload(c *macaron.Context, repo *db.Repository, oid _, err := db.LFS.GetObjectByOID(c.Req.Context(), repo.ID, oid) if err == nil { // Object exists, drain the request body and we're good. - _, _ = io.Copy(ioutil.Discard, c.Req.Request.Body) + _, _ = io.Copy(io.Discard, c.Req.Request.Body) c.Req.Request.Body.Close() c.Status(http.StatusOK) return @@ -123,7 +122,8 @@ func (h *basicHandler) serveUpload(c *macaron.Context, repo *db.Repository, oid // POST /{owner}/{repo}.git/info/lfs/object/basic/verify func (*basicHandler) serveVerify(c *macaron.Context, repo *db.Repository) { var request basicVerifyRequest - defer c.Req.Request.Body.Close() + defer func() { _ = c.Req.Request.Body.Close() }() + err := json.NewDecoder(c.Req.Request.Body).Decode(&request) if err != nil { responseJSON(c.Resp, http.StatusBadRequest, responseError{ |