优化代码

This commit is contained in:
GoEdgeLab
2022-08-04 11:34:06 +08:00
parent 9c00b07d9e
commit bcd6784a8f
31 changed files with 66 additions and 82 deletions

View File

@@ -4,7 +4,7 @@ package iplibrary
import (
"errors"
"io/ioutil"
"os"
"strconv"
"strings"
)
@@ -62,7 +62,7 @@ func getIpInfo(cityId int64, line []byte) *IpInfo {
func NewIP2Region(path string) (*IP2Region, error) {
var region = &IP2Region{}
region.dbData, err = ioutil.ReadFile(path)
region.dbData, err = os.ReadFile(path)
if err != nil {
return nil, err