summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorhorus_arch2015-06-15 17:07:32 +0200
committerhorus_arch2015-06-15 17:07:32 +0200
commite205935a4fd7ae56a352d5dd8d1b69f143afb09c (patch)
treed0bd3a4d6eb9c26f1a4df2dd74c7def5c0090407 /main.go
parentffdfbb70cf2af25482b56f08e8cad53104d91e61 (diff)
downloaduhttpd-e205935a4fd7ae56a352d5dd8d1b69f143afb09c.tar.gz
Fix flex warnings and removes unnecessary include.
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 6 insertions, 0 deletions
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 + "/")
}