mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-10 09:32:32 +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()
|
|
}
|