Documentation
¶
Overview ¶
Package ipaddr is a fork of a subset of the Go standard "net" package which retains parsing behaviors from Go 1.16 or earlier.
Don't use this for any new code without careful consideration. See the README.md in the package directory for more information.
Index ¶
Constants ¶
View Source
const ( IPv4len = stdnet.IPv4len IPv6len = stdnet.IPv6len )
Variables ¶
View Source
var ( CIDRMask = stdnet.CIDRMask IPv4 = stdnet.IPv4 )
Functions ¶
func ParseCIDR ¶
ParseCIDR parses s as a CIDR notation IP address and prefix length, like "192.0.2.0/24" or "2001:db8::/32", as defined in RFC 4632 and RFC 4291.
It returns the IP address and the network implied by the IP and prefix length. For example, ParseCIDR("192.0.2.1/24") returns the IP address 192.0.2.1 and the network 192.0.2.0/24.
Types ¶
type IP ¶
type ParseError ¶
type ParseError = stdnet.ParseError
Click to show internal directories.
Click to hide internal directories.