1
0
mirror of https://github.com/golang/go synced 2024-09-30 08:18:40 -06:00

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: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Mikio Hara 2016-12-15 06:26:58 +09:00
parent c1ada22bc1
commit 6f5a77bf5f

View File

@ -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 {