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

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

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -