MCPcopy
hub / github.com/nats-io/nats.go / hostIsIP

Function hostIsIP

nats.go:2055–2057  ·  view source on GitHub ↗

Return true iff u.Hostname() is an IP address.

(u *url.URL)

Source from the content-addressed store, hash-verified

2053
2054// Return true iff u.Hostname() is an IP address.
2055func hostIsIP(u *url.URL) bool {
2056 return net.ParseIP(u.Hostname()) != nil
2057}
2058
2059// parseServerURL parses a server URL string into a Server struct.
2060// It handles scheme defaults and port defaults. Does not validate websocket consistency.

Callers 2

parseServerURLMethod · 0.85
processInfoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected