Golang net.IP.IsInterfaceLocalMulticast(), IsLinkLocalMulticast(), IsLinkLocalUnicast() functions example
package net
Golang net.IP.IsInterfaceLocalMulticast(), IsLinkLocalMulticast(), IsLinkLocalUnicast() functions usage example
package main
import (
"fmt"
"net"
)
func main() {
ip4 := "127.0.0.1"
// convert to IP type
ipAdd4 := net.ParseIP(ip4)
fmt.Println("127.0.0.1 is local multicase interface : ", ipAdd4.IsInterfaceLocalMulticast())
fmt.Println("127.0.0.1 is local multicase link : ", ipAdd4.IsLinkLocalMulticast())
fmt.Println("127.0.0.1 is local link unicast : ", ipAdd4.IsLinkLocalUnicast())
}
Output :
127.0.0.1 is local multicase interface : false
127.0.0.1 is local multicase link : false
127.0.0.1 is local link unicast : false
References :
http://golang.org/pkg/net/#IP.IsInterfaceLocalMulticast
http://golang.org/pkg/net/#IP.IsLinkLocalMulticast
Advertisement
Something interesting
Tutorials
+7.5k Golang : Handling Yes No Quit query input
+9.7k Golang : interface - when and where to use examples
+14.9k Golang : How to check for empty array string or string?
+13.8k Golang : Gin framework accept query string by post request example
+11.5k Use systeminfo to find out installed Windows Hotfix(s) or updates
+19.2k Golang : Execute shell command
+15k Golang : package is not in GOROOT during compilation
+13.7k Golang : Activate web camera and broadcast out base64 encoded images
+16.9k Golang : How to generate QR codes?
+6.8k Android Studio : Hello World example
+22.7k Golang : Strings to lowercase and uppercase example
+7.6k Android Studio : AlertDialog to get user attention example