Commit b8d56fdd authored by Mikio Hara's avatar Mikio Hara

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/33262Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent b2d34fa5
...@@ -37,11 +37,13 @@ func ExampleListener() { ...@@ -37,11 +37,13 @@ func ExampleListener() {
} }
func ExampleCIDRMask() { func ExampleCIDRMask() {
// This mask corresponds to a /31 subnet // This mask corresponds to a /31 subnet for IPv4.
fmt.Println(net.CIDRMask(31, 32)) 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)) fmt.Println(net.CIDRMask(64, 128))
// Output: fffffffe
// Output:
// fffffffe
// ffffffffffffffff0000000000000000 // ffffffffffffffff0000000000000000
} }
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