qqwry/qqwry_test.go

21 lines
296 B
Go
Raw Normal View History

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"
city, area, err := QueryIP(queryIp)
if err != nil {
t.Fatal(err)
}
t.Logf("城市:%s区域%s", city, area)
}