qqwry/qqwry_test.go

21 lines
303 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package qqwry
import (
"testing"
)
func init() {
if err := LoadFile("assets/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)
}