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

Popular posts from this blog

javascript - THREE.js reposition vertices for RingGeometry -

javascript - I need to update the text of a paragraph by inline edit -

assembly - What is the addressing mode for ld, add, and rjmp instructions? -