3 ms·
net.Dial() really is terrible, but it's fairly easy to work around. Instead of passing a hostname to net.Dial(), you can call net.LookupHost(...) and iterate o
by p1mrx 12y ago
net.Dial() really is terrible, but it's fairly easy to work around. Instead of passing a hostname to net.Dial(), you can call net.LookupHost(...) and iterate over the resulting IP addresses.
- hobarrera 12y agoIt sounds that it adds too much burden to developers to simply communicate to some host over HTTP. It sounds pretty hard to convince every single developer out there to replace net.Dial with that.