From 232c466c242cd6c2215570b9635efc731cafd194 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Mon, 15 Aug 2016 13:33:50 +0200 Subject: Print IP and Hostname at same line --- ip.go | 3 +-- 1 file changed, 1 insertion(+), 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) } -- cgit v1.2.3