Ajout système d'interface

This commit is contained in:
2022-03-08 14:58:41 +01:00
parent 30e21ce042
commit 51defc39ac
5 changed files with 77 additions and 23 deletions

View File

@@ -0,0 +1,24 @@
package utils
import (
"fmt"
"net"
)
func NetworkLister() {
// Retrieve Interfaces
inter, err := net.Interfaces()
// Process errors
if err != nil {
println("[ERROR] An error occurred : " + err.Error())
return
}
// Display items
println("\n\nNetwork interface list :")
for i, val := range inter {
fmt.Printf("%d. %s\n", i, val.Name)
}
print("\n")
}