Skip to content

Commit

Permalink
net: fix ParseCIDR docs
Browse files Browse the repository at this point in the history
This change replaces the remaining use of "mask" with "prefix length"
and uses IPv4 reserved address blocks for documentation.

UPdates golang#15228.
Updates golang#18175.

Change-Id: I56c4f1205821c64f3195b023ad515b9d54e33f64
Reviewed-on: https://go-review.googlesource.com/34431
Run-TryBot: Mikio Hara <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
cixtor committed Dec 15, 2016
1 parent c1ada22 commit 6f5a77b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/net/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6f5a77b

Please sign in to comment.