mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-18 13:38:10 -07:00
initial UBAN implementation
This commit is contained in:
@@ -183,6 +183,16 @@ func (cidr IPNet) String() string {
|
||||
return ipnet.String()
|
||||
}
|
||||
|
||||
// HumanReadableString returns a string representation of an IPNet;
|
||||
// if the network contains only a single IP address, it returns
|
||||
// a representation of that address.
|
||||
func (cidr IPNet) HumanReadableString() string {
|
||||
if cidr.PrefixLen == 128 {
|
||||
return cidr.IP.String()
|
||||
}
|
||||
return cidr.String()
|
||||
}
|
||||
|
||||
// IsZero tests whether ipnet is the zero value of an IPNet, 0::0/0.
|
||||
// Although this is a valid subnet, it can still be used as a sentinel
|
||||
// value in some contexts.
|
||||
|
||||
Reference in New Issue
Block a user