From 1e732ca388054281f43183f01c233611dd938782 Mon Sep 17 00:00:00 2001 From: Rob Phoenix Date: Tue, 9 May 2017 10:26:08 +0100 Subject: [PATCH] net: fix ExampleParseCIDR IPv4 prefix length Issue #15228 describes that reserved address blocks should be used for documentation purposes. This change updates the prefix length so the IPv4 address adheres to this. Change-Id: I237d9cce1a71f4fd95f927ec894ce53fa806047f Reviewed-on: https://go-review.googlesource.com/42991 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/net/example_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net/example_test.go b/src/net/example_test.go index bfab21c589..979d8170aa 100644 --- a/src/net/example_test.go +++ b/src/net/example_test.go @@ -44,7 +44,7 @@ func ExampleIPv4() { } func ExampleParseCIDR() { - ipv4Addr, ipv4Net, err := net.ParseCIDR("192.0.2.1/16") + ipv4Addr, ipv4Net, err := net.ParseCIDR("192.0.2.1/24") if err != nil { log.Fatal(err) } @@ -60,7 +60,7 @@ func ExampleParseCIDR() { // Output: // 192.0.2.1 - // 192.0.0.0/16 + // 192.0.2.0/24 // 2001:db8:a0b:12f0::1 // 2001:db8::/32 } -- 2.50.0