优化代码

This commit is contained in:
刘祥超
2022-08-04 11:41:42 +08:00
parent b8babaae39
commit 0414cc02e8
16 changed files with 38 additions and 44 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