go net package's TCPAddr String function returns a string representation of a TCP address in the format "host:port". This function is used to convert a TCPAddr structure into a human-readable string.
Here, we are creating a new TCP address structure with IP address 127.0.0.1 and port number 8080. We are then using the String function to convert this structure into a string representation of the form "host:port".
Here, we are resolving the TCP address for the host "google.com" and port 80 using the ResolveTCPAddr function. We then use the String function to convert this structure into a string representation of the form "host:port".
Package library: net - https://golang.org/pkg/net/
Golang TCPAddr.String - 30 examples found. These are the top rated real world Golang examples of net.TCPAddr.String extracted from open source projects. You can rate examples to help us improve the quality of examples.