summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-08-15 13:33:50 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-08-15 13:33:50 +0200
commit232c466c242cd6c2215570b9635efc731cafd194 (patch)
tree757731e6be17338e66adc3b8348a7031f8236e98
parent6eedcc36568c787601f6b070b54a76e9992ae44f (diff)
Print IP and Hostname at same line
-rw-r--r--ip.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/ip.go b/ip.go
index a24fb1f..9a11b8f 100644
--- a/ip.go
+++ b/ip.go
@@ -17,11 +17,10 @@ func ip(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
- fmt.Fprintln(w, addr)
host, err := net.LookupAddr(addr)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
- fmt.Fprintln(w, host)
+ fmt.Fprintln(w, addr, host)
}