Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
emilevauge committed Sep 22, 2015
1 parent c422047 commit 64ddc0a
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package main

import (
"fmt"
"github.com/gorilla/mux"
"log"
"net"
"net/http"
"github.com/gorilla/mux"
"os"
"net"
)

func main() {
Expand All @@ -24,18 +24,18 @@ func whoamI(w http.ResponseWriter, req *http.Request) {
ifaces, _ := net.Interfaces()
// handle err
for _, i := range ifaces {
addrs, _ := i.Addrs()
// handle err
for _, addr := range addrs {
var ip net.IP
switch v := addr.(type) {
case *net.IPNet:
ip = v.IP
case *net.IPAddr:
ip = v.IP
}
fmt.Fprintln(w, "IP : ", ip)
}
addrs, _ := i.Addrs()
// handle err
for _, addr := range addrs {
var ip net.IP
switch v := addr.(type) {
case *net.IPNet:
ip = v.IP
case *net.IPAddr:
ip = v.IP
}
fmt.Fprintln(w, "IP : ", ip)
}
}
req.Write(w)
req.Write(w)
}

0 comments on commit 64ddc0a

Please sign in to comment.