[go] net: use of IPv4/IPv6 reserved address blocks for documentation

146 views
Skip to first unread message

Mikio Hara (Gerrit)

unread,
May 16, 2016, 11:24:54 PM5/16/16
to Ian Lance Taylor, golang-co...@googlegroups.com
Mikio Hara uploaded a change:
https://go-review.googlesource.com/23126

net: use of IPv4/IPv6 reserved address blocks for documentation

Also replaces google.com with golang.org in package documentation.

Updates #15228.

Change-Id: I554fa960878fa44557a522635ed412d8d7548d3f
---
M src/net/dial.go
M src/net/ip.go
M src/net/net.go
3 files changed, 14 insertions(+), 14 deletions(-)



diff --git a/src/net/dial.go b/src/net/dial.go
index 16f67a2..55edb43 100644
--- a/src/net/dial.go
+++ b/src/net/dial.go
@@ -241,8 +241,8 @@
// If the host is empty, as in ":80", the local system is assumed.
//
// Examples:
-// Dial("tcp", "12.34.56.78:80")
-// Dial("tcp", "google.com:http")
+// Dial("tcp", "192.0.2.1:80")
+// Dial("tcp", "golang.org:http")
// Dial("tcp", "[2001:db8::1]:http")
// Dial("tcp", "[fe80::1%lo0]:80")
// Dial("tcp", ":80")
@@ -252,8 +252,8 @@
// literal IP address.
//
// Examples:
-// Dial("ip4:1", "127.0.0.1")
-// Dial("ip6:ospf", "::1")
+// Dial("ip4:1", "192.0.2.1")
+// Dial("ip6:ipv6-icmp", "2001:db8::1")
//
// For Unix networks, the address must be a file system path.
func Dial(network, address string) (Conn, error) {
diff --git a/src/net/ip.go b/src/net/ip.go
index a2361bb..3616334 100644
--- a/src/net/ip.go
+++ b/src/net/ip.go
@@ -255,7 +255,7 @@
// It returns one of 4 forms:
// - "<nil>", if ip has length 0
// - dotted decimal ("192.0.2.1"), if ip is an IPv4 or IP4-mapped IPv6
address
-// - IPv6 ("2001:db9::1"), if ip is a valid IPv6 address
+// - IPv6 ("2001:db8::1"), if ip is a valid IPv6 address
// - the hexadecimal form of ip, without punctuation, if no other cases
apply
func (ip IP) String() string {
p := ip
@@ -483,12 +483,12 @@
// Network returns the address's network name, "ip+net".
func (n *IPNet) Network() string { return "ip+net" }

-// String returns the CIDR notation of n like "192.168.100.1/24"
-// or "2001:DB8::/48" as defined in RFC 4632 and RFC 4291.
+// String returns the CIDR notation of n like "192.0.2.1/24"
+// or "2001:db8::/48" as defined in RFC 4632 and RFC 4291.
// If the mask is not in the canonical form, it returns the
// string which consists of an IP address, followed by a slash
// character and a mask expressed as hexadecimal form with no
-// punctuation like "192.168.100.1/c000ff00".
+// punctuation like "198.51.100.1/c000ff00".
func (n *IPNet) String() string {
nn, m := networkNumberAndMask(n)
if nn == nil || m == nil {
@@ -641,8 +641,8 @@
}

// ParseIP parses s as an IP address, returning the result.
-// The string s can be in dotted decimal ("74.125.19.99")
-// or IPv6 ("2001:4860:0:2001::68") form.
+// The string s can be in dotted decimal ("192.0.2.1")
+// or IPv6 ("2001:db8::1") form.
// If s is not a valid textual representation of an IP address,
// ParseIP returns nil.
func ParseIP(s string) IP {
@@ -659,12 +659,12 @@
}

// ParseCIDR parses s as a CIDR notation IP address and mask,
-// like "192.168.100.1/24" or "2001:DB8::/48", as defined in
+// 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("192.168.100.1/16") returns
-// the IP address 192.168.100.1 and the network 192.168.0.0/16.
+// 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.
func ParseCIDR(s string) (IP, *IPNet, error) {
i := byteIndex(s, '/')
if i < 0 {
diff --git a/src/net/net.go b/src/net/net.go
index 27e9ca3..d6812d1 100644
--- a/src/net/net.go
+++ b/src/net/net.go
@@ -14,7 +14,7 @@

The Dial function connects to a server:

- conn, err := net.Dial("tcp", "google.com:80")
+ conn, err := net.Dial("tcp", "golang.org:80")
if err != nil {
// handle error
}

--
https://go-review.googlesource.com/23126

Mikio Hara (Gerrit)

unread,
May 16, 2016, 11:26:16 PM5/16/16
to golang-co...@googlegroups.com
Mikio Hara has posted comments on this change.

net: use of IPv4/IPv6 reserved address blocks for documentation

Patch Set 1: Run-TryBot+1

--
https://go-review.googlesource.com/23126
Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
Gerrit-HasComments: No

Gobot Gobot (Gerrit)

unread,
May 16, 2016, 11:27:11 PM5/16/16
to golang-co...@googlegroups.com
Gobot Gobot has posted comments on this change.

net: use of IPv4/IPv6 reserved address blocks for documentation

Patch Set 1:

TryBots beginning. Status page: http://farmer.golang.org/try?commit=3bbf9499

--
https://go-review.googlesource.com/23126
Gerrit-Reviewer: Gobot Gobot <go...@golang.org>

Brad Fitzpatrick (Gerrit)

unread,
May 16, 2016, 11:34:56 PM5/16/16
to Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com
Brad Fitzpatrick has posted comments on this change.

net: use of IPv4/IPv6 reserved address blocks for documentation

Patch Set 1: Code-Review+2

(3 comments)

https://go-review.googlesource.com/#/c/23126/1//COMMIT_MSG
Commit Message:

Line 7: net: use of IPv4/IPv6 reserved address blocks for documentation
delete the word "of"


https://go-review.googlesource.com/#/c/23126/1/src/net/dial.go
File src/net/dial.go:

Line 255: // Dial("ip4:1", "192.0.2.1")
these two lines of changes were unnecessary


https://go-review.googlesource.com/#/c/23126/1/src/net/ip.go
File src/net/ip.go:

Line 645: // or IPv6 ("2001:db8::1") form.
why changing it to end in ::1?


--
https://go-review.googlesource.com/23126
Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
Gerrit-HasComments: Yes

Mikio Hara (Gerrit)

unread,
May 16, 2016, 11:45:03 PM5/16/16
to Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com
Reviewers: Brad Fitzpatrick

Mikio Hara uploaded a new patch set:
https://go-review.googlesource.com/23126

net: use of IPv4/IPv6 reserved address blocks for documentation

Also replaces google.com with golang.org in package documentation.

Updates #15228.

Change-Id: I554fa960878fa44557a522635ed412d8d7548d3f
---
M src/net/dial.go
M src/net/ip.go
M src/net/net.go
3 files changed, 14 insertions(+), 14 deletions(-)


Mikio Hara (Gerrit)

unread,
May 16, 2016, 11:45:33 PM5/16/16
to Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com
Mikio Hara has posted comments on this change.

net: use of IPv4/IPv6 reserved address blocks for documentation

Patch Set 1:

(2 comments)

https://go-review.googlesource.com/#/c/23126/1/src/net/dial.go
File src/net/dial.go:

Line 255: // Dial("ip4:1", "192.0.2.1")
> these two lines of changes were unnecessary
talking to the kernel with icmp is a bit tricky, as tests in x/net/icmp do.
also, communicating ospf with a fixed pair of addresses is just for ospf
over p2p link mode. i'd prefer to change.


https://go-review.googlesource.com/#/c/23126/1/src/net/ip.go
File src/net/ip.go:

Line 645: // or IPv6 ("2001:db8::1") form.
> why changing it to end in ::1?
nothing, i'm fine w/ 68.


--
https://go-review.googlesource.com/23126
Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
Gerrit-Reviewer: Mikio Hara <mikioh...@gmail.com>
Gerrit-HasComments: Yes

Brad Fitzpatrick (Gerrit)

unread,
May 16, 2016, 11:55:59 PM5/16/16
to Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com
Brad Fitzpatrick has posted comments on this change.

net: use of IPv4/IPv6 reserved address blocks for documentation

Patch Set 1:

(1 comment)

https://go-review.googlesource.com/#/c/23126/1/src/net/dial.go
File src/net/dial.go:

Line 255: // Dial("ip4:1", "192.0.2.1")
> talking to the kernel with icmp is a bit tricky, as tests in x/net/icmp
> do.
as you wish

Mikio Hara (Gerrit)

unread,
May 17, 2016, 12:00:35 AM5/17/16
to Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com
Mikio Hara has posted comments on this change.

net: use of IPv4/IPv6 reserved address blocks for documentation

Patch Set 1:

(1 comment)

https://go-review.googlesource.com/#/c/23126/1//COMMIT_MSG
Commit Message:

Line 7: net: use of IPv4/IPv6 reserved address blocks for documentation
> delete the word "of"
Done

Mikio Hara (Gerrit)

unread,
May 17, 2016, 12:00:47 AM5/17/16
to Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com
Reviewers: Brad Fitzpatrick

Mikio Hara uploaded a new patch set:
https://go-review.googlesource.com/23126

net: use IPv4/IPv6 reserved address blocks for documentation

Also replaces google.com with golang.org in package documentation.

Updates #15228.

Change-Id: I554fa960878fa44557a522635ed412d8d7548d3f
---
M src/net/dial.go
M src/net/ip.go
M src/net/net.go
3 files changed, 14 insertions(+), 14 deletions(-)


Mikio Hara (Gerrit)

unread,
May 17, 2016, 12:02:15 AM5/17/16
to golang-...@googlegroups.com, Brad Fitzpatrick, Gobot Gobot, golang-co...@googlegroups.com
Mikio Hara has submitted this change and it was merged.

net: use IPv4/IPv6 reserved address blocks for documentation

Also replaces google.com with golang.org in package documentation.

Updates #15228.

Change-Id: I554fa960878fa44557a522635ed412d8d7548d3f
Reviewed-on: https://go-review.googlesource.com/23126
Reviewed-by: Brad Fitzpatrick <brad...@golang.org>
---
M src/net/dial.go
M src/net/ip.go
M src/net/net.go
3 files changed, 14 insertions(+), 14 deletions(-)

Approvals:
Brad Fitzpatrick: Looks good to me, approved
Reply all
Reply to author
Forward
0 new messages