Created
March 26, 2019 06:51
-
-
Save ik5/4ef45781f37441b9b1d0a5c37ee6a7cb to your computer and use it in GitHub Desktop.
list all ethernet interfaces and its data including mtu, state etc...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net" | |
) | |
func main() { | |
ifaces, err := net.Interfaces() | |
for _, iface := range ifaces { | |
fmt.Printf("%+v, %+v\n", iface, err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment