Commit 6f5a77bf authored by Mikio Hara's avatar Mikio Hara

net: fix ParseCIDR docs

This change replaces the remaining use of "mask" with "prefix length"
and uses IPv4 reserved address blocks for documentation.

UPdates #15228.
Updates #18175.

Change-Id: I56c4f1205821c64f3195b023ad515b9d54e33f64
Reviewed-on: https://go-review.googlesource.com/34431
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent c1ada22b
......@@ -658,9 +658,10 @@ func ParseIP(s string) IP {
// 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 mask. For example, ParseCIDR("198.51.100.1/24") returns
// the IP address 198.51.100.1 and the network 198.51.100.0/24.
// 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
// 198.0.2.1 and the network 198.0.2.0/24.
func ParseCIDR(s string) (IP, *IPNet, error) {
i := byteIndex(s, '/')
if i < 0 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment