HasPort when given a string of the form "host", "host:port", or "[ipv6::address]:port", returns true if the string includes a port.
(s string)
| 161 | // HasPort when given a string of the form "host", "host:port", or |
| 162 | // "[ipv6::address]:port", returns true if the string includes a port. |
| 163 | func HasPort(s string) bool { |
| 164 | return strings.LastIndex(s, ":") > strings.LastIndex(s, "]") |
| 165 | } |
| 166 | |
| 167 | // IsFQDN reports whether domain looks like a fully qualified domain name. |
| 168 | func IsFQDN(domain string) bool { |