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
+17k Golang : Get input from keyboard
+11k How to test Facebook App on localhost ?
+5.2k Golang : Customize scanner.Scanner to treat dash as part of identifier
+9.1k Golang : Simple histogram example
+20.7k Golang : Saving private and public key to files
+4.6k Linux : sudo yum updates not working
+8.2k Android Studio : Rating bar example
+8.1k Golang : Randomize letters from a string example
+20.9k Golang : Convert PNG transparent background image to JPG or JPEG image
+11.3k Golang : Characters limiter example
+10k Golang : Read file and convert content to string
+17.4k Golang : Get future or past hours, minutes or seconds