mirror of
https://github.com/xiaoqidun/qqwry.git
synced 2026-08-26 02:14:42 +08:00
feat(升级依赖): 升级golang.org/x/text到v0.41.0
This commit is contained in:
@@ -4,5 +4,5 @@ go 1.25.0
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/ipipdotnet/ipdb-go v1.3.3
|
github.com/ipipdotnet/ipdb-go v1.3.3
|
||||||
golang.org/x/text v0.40.0
|
golang.org/x/text v0.41.0
|
||||||
)
|
)
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
github.com/ipipdotnet/ipdb-go v1.3.3 h1:GLSAW9ypLUd6EF9QNK2Uhxew9Jzs4XMJ9gOZEFnJm7U=
|
github.com/ipipdotnet/ipdb-go v1.3.3 h1:GLSAW9ypLUd6EF9QNK2Uhxew9Jzs4XMJ9gOZEFnJm7U=
|
||||||
github.com/ipipdotnet/ipdb-go v1.3.3/go.mod h1:yZ+8puwe3R37a/3qRftXo40nZVQbxYDLqls9o5foexs=
|
github.com/ipipdotnet/ipdb-go v1.3.3/go.mod h1:yZ+8puwe3R37a/3qRftXo40nZVQbxYDLqls9o5foexs=
|
||||||
golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
|
golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8=
|
||||||
golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
|
golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M=
|
||||||
@@ -69,7 +69,7 @@ func (c *Client) QueryIP(ip string) (location *Location, err error) {
|
|||||||
return nil, errors.New("data type not support")
|
return nil, errors.New("data type not support")
|
||||||
}
|
}
|
||||||
if err == nil && location != nil {
|
if err == nil && location != nil {
|
||||||
c.cache.Add(ip, location)
|
c.cache.Add(ip, location.Clone())
|
||||||
}
|
}
|
||||||
return location, err
|
return location, err
|
||||||
}
|
}
|
||||||
+1
-1
@@ -12,7 +12,7 @@ type cacheEntry struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cache 简单的LRU缓存实现
|
// Cache 简单的LRU缓存实现
|
||||||
// 字段: capacity 容量, list 双向链表, items哈希表, lock 互斥锁
|
// 字段: capacity 容量, list 双向链表, items 哈希表, lock 互斥锁
|
||||||
type Cache struct {
|
type Cache struct {
|
||||||
capacity int
|
capacity int
|
||||||
list *list.List
|
list *list.List
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ const (
|
|||||||
|
|
||||||
// byte3ToUInt32 将3字节切片转换为uint32
|
// byte3ToUInt32 将3字节切片转换为uint32
|
||||||
// 入参: data 3字节切片
|
// 入参: data 3字节切片
|
||||||
// 返回: uint32转换后的值
|
// 返回: uint32 转换后的值
|
||||||
func byte3ToUInt32(data []byte) uint32 {
|
func byte3ToUInt32(data []byte) uint32 {
|
||||||
i := uint32(data[0]) & 0xff
|
i := uint32(data[0]) & 0xff
|
||||||
i |= (uint32(data[1]) << 8) & 0xff00
|
i |= (uint32(data[1]) << 8) & 0xff00
|
||||||
|
|||||||
Reference in New Issue
Block a user