kefu/tools/ipdb_test.go

33 lines
565 B
Go
Raw Normal View History

2024-12-10 02:50:12 +00:00
package tools
import (
"log"
"strings"
"testing"
)
func TestNewIpdb(t *testing.T) {
var ip, ipstr string
var infos []string
p, _ := NewIpdb("../config/qqzeng-ip-utf8.dat")
ip = "113.104.209.240"
ipstr = p.Get(ip)
infos = strings.Split(ipstr, "|")
log.Println(infos)
ip = "39.155.215.54"
ipstr = p.Get(ip)
infos = strings.Split(ipstr, "|")
log.Println(infos)
ip = "127.0.0.1"
ipstr = p.Get(ip)
infos = strings.Split(ipstr, "|")
log.Println(infos)
ip = "192.168.1.1"
ipstr = p.Get(ip)
infos = strings.Split(ipstr, "|")
log.Println(infos)
}