Check If a Go Client Has Reused a Connection
For logging purposes, performance monitoring, debugging - what ever your reason, it can be useful to know if Go has reused it’s connection when making an initial request, for later use. If it’s not reusing connections, it might be running slower and less efficiently than it needs to be.
The code below is used as an example of how to log if connections are being reused, as well as outputting the DNS information gathered.