Style: format code

This commit is contained in:
yaling888
2021-10-28 00:06:55 +08:00
parent 433d35e866
commit 2953772a0e
23 changed files with 280 additions and 545 deletions

View File

@@ -2,7 +2,7 @@ package memconservative
import (
"fmt"
"io/ioutil"
"os"
"strings"
C "github.com/Dreamacro/clash/constant"
@@ -54,7 +54,7 @@ func (g GeoIPCache) Unmarshal(filename, code string) (*router.GeoIP, error) {
case errFailedToReadBytes, errFailedToReadExpectedLenBytes,
errInvalidGeodataFile, errInvalidGeodataVarintLength:
log.Warnln("failed to decode geoip file: %s%s", filename, ", fallback to the original ReadFile method")
geoipBytes, err = ioutil.ReadFile(asset)
geoipBytes, err = os.ReadFile(asset)
if err != nil {
return nil, err
}
@@ -119,7 +119,7 @@ func (g GeoSiteCache) Unmarshal(filename, code string) (*router.GeoSite, error)
case errFailedToReadBytes, errFailedToReadExpectedLenBytes,
errInvalidGeodataFile, errInvalidGeodataVarintLength:
log.Warnln("failed to decode geoip file: %s%s", filename, ", fallback to the original ReadFile method")
geositeBytes, err = ioutil.ReadFile(asset)
geositeBytes, err = os.ReadFile(asset)
if err != nil {
return nil, err
}