mirror of
https://github.com/golang/go
synced 2024-11-12 03:50:21 -07:00
net: tweak comment on ExampleCIDRMask
CIDRMask just returns a mask which corresponds to an address prefix in CIDR nonation. A subnet for an IPv6 mask sounds a bit confusing. Change-Id: Ic7859ce992bc2de4043d3b25caf9a1051d118b0e Reviewed-on: https://go-review.googlesource.com/33262 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
b2d34fa51b
commit
b8d56fdd93
@ -37,11 +37,13 @@ func ExampleListener() {
|
||||
}
|
||||
|
||||
func ExampleCIDRMask() {
|
||||
// This mask corresponds to a /31 subnet
|
||||
// This mask corresponds to a /31 subnet for IPv4.
|
||||
fmt.Println(net.CIDRMask(31, 32))
|
||||
|
||||
// This mask corresponds to a /64 subnet for a IPv6 mask
|
||||
// This mask corresponds to a /64 subnet for IPv6.
|
||||
fmt.Println(net.CIDRMask(64, 128))
|
||||
// Output: fffffffe
|
||||
|
||||
// Output:
|
||||
// fffffffe
|
||||
// ffffffffffffffff0000000000000000
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user