Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasPort ¶
HostPort returns whether addr includes a port number (i.e., is of the form HOST:PORT). It handles a corner-case in net.SplitHostPort which returns an empty port for addresses of the form "1.2.3.4:". For such addresses, HasPort returns false.
func TryJoinHostPort ¶
TryJoinHostPort checks whether the server string already has a port (i.e., ends with ':<PORT>'. If it does, then the function simply returns that string. If it does not, it returns the server string with the port appended.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.