netmaker/netclient/ncutils/iface.go
2023-02-26 16:28:16 -05:00

19 lines
342 B
Go

package ncutils
import (
"net"
)
// StringSliceContains - sees if a string slice contains a string element
func StringSliceContains(slice []string, item string) bool {
for _, s := range slice {
if s == item {
return true
}
}
return false
}
func IpIsPrivate(ipnet net.IP) bool {
return ipnet.IsPrivate() || ipnet.IsLoopback()
}