ZiZhao Zhang has uploaded this change for review.
net: update comments preceding IP.String to reflect RFC 5952 conformance status
Fixes #44485
Change-Id: I4b101e5d18cde30a66ab9a2c72704876827fff04
---
M src/net/ip.go
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/net/ip.go b/src/net/ip.go
index 38e1aa2..6e01468 100644
--- a/src/net/ip.go
+++ b/src/net/ip.go
@@ -304,7 +304,7 @@
return 3
}
-// String returns the string form of the IP address ip.
+// String returns the string form of the IP address ip as defined in RFC 5952.
// 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
To view, visit change 337369. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Elliot Cameron, ZiZhao Zhang, Ian Lance Taylor.
1 comment:
File src/net/ip.go:
Patch Set #1, Line 307: // String returns the string form of the IP address ip as defined in RFC 5952.
This isn't correct: RFC 5952 defines the text representation of IPv6 addresses, but IP.String returns one of three other forms when the IP does not contain an IPv6 address.
I'm not certain that it's necessary for IP.String to reference RFC 5952, given that there are (to the best of my knowledge) no other text representations of IPv6 addresses in common use.
To view, visit change 337369. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Elliot Cameron, ZiZhao Zhang, Ian Lance Taylor.
1 comment:
File src/net/ip.go:
Patch Set #1, Line 307: // String returns the string form of the IP address ip as defined in RFC 5952.
This isn't correct: RFC 5952 defines the text representation of IPv6 addresses, but IP. […]
...I suppose there are various non-canonical forms, such as 2001:db8:0:0:0:0:0:1, so specifying that the IPv6 representation conforms to RFC 5952 does have meaning.
A question then is whether IP.String *should* be constrained to conform to RFC 5952. This does seems reasonable to me.
To view, visit change 337369. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Elliot Cameron, ZiZhao Zhang, Ian Lance Taylor.
ZiZhao Zhang uploaded patch set #2 to this change.
net: update comments preceding IP.String to reflect RFC 5952 conformance status
Fixes #44485
Change-Id: I4b101e5d18cde30a66ab9a2c72704876827fff04
---
M src/net/ip.go
1 file changed, 1 insertion(+), 1 deletion(-)
To view, visit change 337369. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Elliot Cameron, Damien Neil, Ian Lance Taylor.
1 comment:
File src/net/ip.go:
Patch Set #1, Line 307: // String returns the string form of the IP address ip as defined in RFC 5952.
... […]
Done
To view, visit change 337369. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Elliot Cameron, Damien Neil, Ian Lance Taylor.
I believe you meant to make Cameron Elliott a reviewer, and not me, Elliot Cameron.
Attention is currently required from: Elliot Cameron, Damien Neil, Ian Lance Taylor.
1 comment:
Patchset:
Patch Set 2:
I believe you meant to make Cameron Elliott a reviewer, and not me, Elliot Cameron.
... sorry
To view, visit change 337369. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Elliot Cameron, ZiZhao Zhang, Ian Lance Taylor.
2 comments:
Patchset:
This is one of two CLs updating the same comment, the other being: https://golang.org/cl/337409
Whichever one gets a +2 first will win, I guess.
File src/net/ip.go:
Patch Set #2, Line 311: // - the IPv6 ("2001:db8::1") as defined in RFC 5952, if ip is a valid IPv6 address.
No need for "the". No terminal period, for consistency with the other list items here. And let's move the example output to the end of the first clause:
```
// - IPv6 as defined in RFC 5952 ("2001:db8::1") , if ip is a valid IPv6 address.
```
To view, visit change 337369. To unsubscribe, or for help writing mail filters, visit settings.
ZiZhao Zhang abandoned this change.
To view, visit change 337369. To unsubscribe, or for help writing mail filters, visit settings.