1
0
Fork 0
forked from External/ergo

type numeric codes

This commit is contained in:
Jeremy Latt 2014-02-14 19:25:14 -08:00
parent 3a9027e3dc
commit 87cc184ec0
4 changed files with 150 additions and 155 deletions

View file

@ -20,17 +20,11 @@ func AddrLookupHostname(addr net.Addr) string {
}
func LookupHostname(addr string) string {
if DEBUG_NET {
log.Printf("LookupHostname(%s)", addr)
}
names, err := net.LookupAddr(addr)
if err != nil {
return addr
}
hostname := strings.TrimSuffix(names[0], ".")
if DEBUG_NET {
log.Printf("LookupHostname(%s) → %s", addr, hostname)
}
return hostname
}