MCPcopy
hub / github.com/perkeep/perkeep / HasPort

Function HasPort

internal/netutil/netutil.go:163–165  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
163func 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.
168func IsFQDN(domain string) bool {

Callers 1

baseURLFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected