优化代码

This commit is contained in:
刘祥超
2022-08-04 11:51:34 +08:00
parent 529b7041e7
commit dad8802fb0
15 changed files with 52 additions and 58 deletions

View File

@@ -14,7 +14,7 @@ import (
"github.com/iwind/TeaGo/logs"
"github.com/iwind/TeaGo/maps"
stringutil "github.com/iwind/TeaGo/utils/string"
"io/ioutil"
"io"
"net/http"
"runtime"
"strings"
@@ -95,7 +95,7 @@ func (this *CheckUpdatesTask) Loop() error {
defer func() {
_ = resp.Body.Close()
}()
data, err := ioutil.ReadAll(resp.Body)
data, err := io.ReadAll(resp.Body)
if err != nil {
return errors.New("read api failed: " + err.Error())
}