Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/GoEdgeLab/EdgeNode
/ IsIPv6
Function
IsIPv6
internal/utils/ip.go:48–54 ·
view source on GitHub ↗
IsIPv6 是否为IPv6
(ip string)
Source
from the content-addressed store, hash-verified
46
47
// IsIPv6 是否为IPv6
48
func
IsIPv6(ip string) bool {
49
var
data = net.ParseIP(ip)
50
if
data == nil {
51
return
false
52
}
53
return
!IsIPv4(ip)
54
}
55
56
// IsWildIP 宽泛地判断一个数据是否为IP
57
func
IsWildIP(v string) bool {
Callers
3
TestIsIPv6
Function · 0.92
runActionSingleIP
Method · 0.92
updateAllowIPList
Method · 0.92
Calls
2
IsIPv4
Function · 0.85
ParseIP
Method · 0.80
Tested by
1
TestIsIPv6
Function · 0.74