Given a string of the form "host", "host:port", or "[ipv6::address]:port", return true if the string includes a port.
(s string)
| 14 | // Given a string of the form "host", "host:port", or "[ipv6::address]:port", |
| 15 | // return true if the string includes a port. |
| 16 | func hasPort(s string) bool { return strings.LastIndex(s, ":") > strings.LastIndex(s, "]") } |
| 17 | |
| 18 | // removeEmptyPort strips the empty port in ":port" to "" |
| 19 | // as mandated by RFC 3986 Section 6.2.3. |
no outgoing calls
no test coverage detected
searching dependent graphs…