forked from External/ergo
type numeric codes
This commit is contained in:
parent
3a9027e3dc
commit
87cc184ec0
4 changed files with 150 additions and 155 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue