mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-14 13:44:37 +08:00
19 lines
342 B
Go
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()
|
|
}
|