Skip to content

Commit

Permalink
bugfix for ipv6
Browse files Browse the repository at this point in the history
  • Loading branch information
phuslu committed Sep 30, 2021
1 parent a5f0b45 commit 28118fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions iploc.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func init() {
ip6bin, _ = io.ReadAll(r)
ip6uint = *(*[]uint64)(unsafe.Pointer(&reflect.SliceHeader{
Data: uintptr(unsafe.Pointer(&ip6bin[0])),
Len: len(ip6bin) / 16,
Cap: len(ip6bin) / 16,
Len: len(ip6bin) / 8,
Cap: len(ip6bin) / 8,
}))
}

Expand Down
2 changes: 1 addition & 1 deletion iploc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestCountry(t *testing.T) {
{"240e:4c:4008::1", "CN"},
{"240e:e8:f089:4877:70d2:775c:91d1:ab12", "CN"},
{"2620:0:2d0:200::7", "US"},
{"2a04:4e42:600::223", "US"},
{"2a04:4e42:600::223", "NL"},
{"::", "ZZ"},
{"::1", "ZZ"},
}
Expand Down

0 comments on commit 28118fc

Please sign in to comment.