1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 00:22:41 +08:00
This commit is contained in:
2022-07-26 14:20:09 +08:00
parent 792458a185
commit 52fabedd66
4 changed files with 64 additions and 14 deletions

View File

@ -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))
}