mirror of
https://github.com/xiaoqidun/qqwry.git
synced 2023-06-27 14:38:22 +08:00
feat(项目文件): 添加qqwry实现文件
This commit is contained in:
20
qqwry_test.go
Normal file
20
qqwry_test.go
Normal file
@ -0,0 +1,20 @@
|
||||
package qqwry
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func init() {
|
||||
if err := LoadFile("qqwry.dat"); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestQueryIP(t *testing.T) {
|
||||
queryIp := "1.1.1.1"
|
||||
country, area, err := QueryIP(queryIp)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(country, area)
|
||||
}
|
Reference in New Issue
Block a user