Skip to content

Commit

Permalink
修复纯真ip2region分隔符显示问题
Browse files Browse the repository at this point in the history
  • Loading branch information
fcwys committed Jul 11, 2024
1 parent 8c65715 commit fafc8d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/ip2region/ip2region.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ func NewIp2Region(filePath string) (*Ip2Region, error) {
func (db Ip2Region) Find(query string, params ...string) (result fmt.Stringer, err error) {
if db.seacher != nil {
res, err := db.seacher.SearchByStr(query)
res=strings.ReplaceAll(res, "|", " ")
res=strings.ReplaceAll(res, "\t", " ")
res = strings.ReplaceAll(res, "|", " ") //替换分割符为空格
res = strings.ReplaceAll(res, "\t", " ") //替换制表符为空格
res = strings.ReplaceAll(res, "–", " ") //替换纯真分隔符为空格
if err != nil {
return nil, err
} else {
Expand Down

0 comments on commit fafc8d7

Please sign in to comment.