Golang net.Flags type and Flags.String() function example
package net
Golang net.Flags type and Flags.String() function usage example
package main
import (
"fmt"
"net"
)
func main() {
interfaces, err := net.Interfaces()
if err != nil {
fmt.Print(err)
return
}
for _, i := range interfaces {
fmt.Printf("Name : %v \n", i.Name)
// see http://golang.org/pkg/net/#Flags
fmt.Println("Interface type and supports : ", i.Flags.String())
}
}
References :
Advertisement
Something interesting
Tutorials
+12k Golang : How to parse plain email text and process email header?
+9.1k Golang : Go as a script or running go with shebang/hashbang style
+7.9k Swift : Convert (cast) String to Double
+12.8k Golang : Sort and reverse sort a slice of bytes
+28.1k Golang : Move file to another directory
+26.4k Golang : Calculate future date with time.Add() function
+4.9k Which content-type(MIME type) to use for JSON data
+5.8k CodeIgniter/PHP : Remove empty lines above RSS or ATOM xml tag
+22.4k Golang : Convert seconds to minutes and remainder seconds
+14.6k Golang : Overwrite previous output with count down timer
+5.9k Unix/Linux : Get reboot history or check when was the last reboot date
+10k Golang : Ordinal and Ordinalize a given number to the English ordinal numeral