Golang net.ParseCIDR() function example
package net
Golang net.ParseCIDR() function usage example
package main
import (
"fmt"
"net"
)
func main() {
ipAddress, IPnet, err := net.ParseCIDR("198.162.0.0/16")
if err != nil {
fmt.Println(err)
}
fmt.Println("IP address :", ipAddress)
fmt.Printf("IP Network : %#v\n ", IPnet)
}
Reference :
Advertisement
Something interesting
Tutorials
+6.5k Golang : Map within a map example
+18.2k Golang : Get path name to current directory or folder
+9.1k Golang : Gonum standard normal random numbers example
+7.5k Golang : How to handle file size larger than available memory panic issue
+19.1k Mac OSX : Homebrew and Golang
+3.4k Golang : Fix go-cron set time not working issue
+37.7k Golang : Comparing date or timestamp
+52.6k Golang : How to get struct field and value by name
+23.7k Find and replace a character in a string in Go
+6.8k Golang : Muxing with Martini example
+7.7k Golang : Error reading timestamp with GORM or SQL driver
+8.2k Golang : Routes multiplexer routing example with regular expression control