Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
wangtuanjie committed Jun 19, 2020
1 parent 5c1788f commit e6509d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion ip17mon.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func InitWithDatx(b []byte) {
func InitWithIpdb(b []byte) {
var err error
def, err = ipdb.NewWith(b)
println(def)
if err != nil {
panic(err)
}
Expand Down
16 changes: 9 additions & 7 deletions ip17mon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,27 @@ func TestAll(t *testing.T) {

l1, err := New("datx/17monipdb.dat")
if err != nil {
t.Fatal(err)
t.Fatal("New failed:", err)
}

l2, err := New("ipdb/city.free.ipdb")
if err != nil {
t.Fatal(err)
t.Fatal("New failed:", err)
}

info1, err := l1.Find("115.231.237.124")
ip := "115.231.237.124"

info1, err := l1.Find(ip)
if err != nil {
t.Fatal(err)
t.Fatal("l1.Find failed:", err)
}

info2, err := l2.Find("115.231.237.124")
info2, err := l2.Find(ip)
if err != nil {
t.Fatal(err)
t.Fatal("l2.Find failed:", err)
}

if *info1 != *info2 {
t.Fatal("xxxoo")
t.Fatalf("info: %v != %v", *info1, *info2)
}
}

0 comments on commit e6509d1

Please sign in to comment.