mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
up
This commit is contained in:
@ -3,6 +3,7 @@ package tests
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"net"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@ -37,3 +38,16 @@ func BenchmarkStringSplice(b *testing.B) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestIPSegment(t *testing.T) {
|
||||
i, n, err := net.ParseCIDR("0.0.0.0/0")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
t.Log(i, n)
|
||||
|
||||
address := net.ParseIP("192.168.0.2")
|
||||
|
||||
t.Log(n.Contains(address))
|
||||
}
|
||||
|
Reference in New Issue
Block a user