12345678910111213141516171819 |
- 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()
- }
|