Go : socket library to get hostname -
Go : socket library to get hostname -
is there equivalent python socket library in go? https://docs.python.org/2/library/socket.html
i want in go:
import socket ip = socket.gethostbyname(domain + ".multi.surbl.org") # translate host name ipv4 address format. what bundle can utilize in go?
thanks!
the net namespace contains methods translate hostnames ip addresses (and few other calls similar what's in python socket namespace)
the phone call you're looking net.lookuphost or net.lookupip;
addrs, err := net.lookuphost(hostname) sockets go websocket
Comments
Post a Comment