From e205935a4fd7ae56a352d5dd8d1b69f143afb09c Mon Sep 17 00:00:00 2001 From: horus_arch Date: Mon, 15 Jun 2015 17:07:32 +0200 Subject: Fix flex warnings and removes unnecessary include. --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index fd2189f..fc55aeb 100644 --- a/main.go +++ b/main.go @@ -53,9 +53,12 @@ func main() { return } + var _haveAddr bool = false + for cnt, adr := range addrs { if ipnet, ok := adr.(*net.IPNet); ok && !ipnet.IP.IsLoopback() { if ipnet.IP.To4() != nil { + _haveAddr = true if cnt > 1 { fmt.Printf(" or http://%s:%s/", ipnet.IP.String(), port) } else { @@ -64,6 +67,9 @@ func main() { } } } + if !_haveAddr { + fmt.Printf("http://127.0.0.1:%s (Info: No internet access detected)", port) + } } else { fmt.Print("http://" + *ip_f + ":" + port + "/") } -- cgit v1.2.3