Chore: Migration 1.19

This commit is contained in:
metacubex
2022-08-11 23:56:50 +08:00
parent 95e602bf3b
commit 637707e58f
6 changed files with 38 additions and 388 deletions

View File

@ -6,8 +6,9 @@ import (
_ "github.com/Dreamacro/clash/component/geodata/standard"
C "github.com/Dreamacro/clash/constant"
"github.com/oschwald/geoip2-golang"
"io/ioutil"
"io"
"net/http"
"os"
"runtime"
)
@ -72,9 +73,9 @@ func downloadForBytes(url string) ([]byte, error) {
}
defer resp.Body.Close()
return ioutil.ReadAll(resp.Body)
return io.ReadAll(resp.Body)
}
func saveFile(bytes []byte, path string) error {
return ioutil.WriteFile(path, bytes, 0o644)
return os.WriteFile(path, bytes, 0o644)
}