initial main file

decided to list all addrs as they show up in different orders on linux derp.
This commit is contained in:
sm
2015-06-23 08:53:40 -07:00
committed by sm
parent 36c773befa
commit e34b5c3996
+24
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)
}
}
}