Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
net: LookupHost returns error when given an IP. #684
Perhaps rather than giving an error, it can act the same way as C's gethostbyname(name)? From the gethostbyname() manpage: If name is an IPv4 or IPv6 address, no lookup is performed and gethostbyname() simply copies name into the h_name field and its struct in_addr equivalent into the h_addr_list field of the returned hostent structure. Which revision are you using? changeset: 5092:c4e62b8f7f1c
I had written a program that needed to Dial() the same host over and over. To avoid doing a dns lookup inside Dial() every time, I would call net.LookupHost() and pass the returned IP to Dial. The program failed when I would call net.LookupHost with an IP, which was unexpected (I was used to the gethostbyname behavior). Not a big deal, but perhaps the behavior should be documented.