Remove ioutil (#18222)

- Don't use `ioutil` package anymore as it doesn't anything special
anymore since Go 1.16:

```
// As of Go 1.16, the same functionality is now provided
// by package io or package os, and those implementations
// should be preferred in new code.
```

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Gusted 2022-01-10 01:48:13 +00:00 committed by GitHub
parent 60b945565d
commit 242dddfcb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View file

@ -5,7 +5,7 @@
package updatechecker
import (
"io/ioutil"
"io"
"net/http"
"code.gitea.io/gitea/modules/appstate"
@ -43,7 +43,7 @@ func GiteaUpdateChecker(httpEndpoint string) error {
return err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return err
}