mirror of
https://github.com/status-im/status-go.git
synced 2025-01-11 07:07:24 +00:00
11 lines
294 B
Go
11 lines
294 B
Go
package utils
|
|
|
|
import "net"
|
|
|
|
func IsIPv4(ip net.IP) bool {
|
|
// If ip is not an IPv4 address, To4 returns nil.
|
|
// Note that there might be some corner cases, where this is not correct.
|
|
// See https://stackoverflow.com/questions/22751035/golang-distinguish-ipv4-ipv6.
|
|
return ip.To4() != nil
|
|
}
|