initial main file

decided to list all addrs as they show up in different orders on linux derp.
This commit is contained in:
Stephen McQuay 2013-01-30 10:00:58 -08:00 committed by stephen mcquay
parent 36c773befa
commit e34b5c3996
1 changed files with 24 additions and 0 deletions

24
main.go Normal file
View File

@ -0,0 +1,24 @@
package main
import (
"fmt"
"log"
"net"
)
func main() {
ifs, err := net.Interfaces()
if err != nil {
log.Fatal("problem geting interfaces")
}
for _, iff := range ifs {
as, err := iff.Addrs()
if err != nil {
log.Fatal("problem geting the address for interface.")
}
if len(as) != 0 {
fmt.Printf("%v: ", iff.Name)
fmt.Printf("%v\n", as)
}
}
}