1
0
mirror of https://github.com/golang/go synced 2024-09-29 14:24:32 -06:00

net: update IP.String doc to reflect RFC 5952 conformance

Fixes #47394
This commit is contained in:
hitzhangjie 2021-08-07 01:57:02 +08:00
parent 1ff831127f
commit ae0242c6d6

View File

@ -308,9 +308,8 @@ func ubtoa(dst []byte, start int, v byte) int {
// 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:db8::1"), if ip is a valid IPv6 address
// - IPv6 conforming to RFC 5952 ("2001:db8::1"), if ip is a valid IPv6 address
// - the hexadecimal form of ip, without punctuation, if no other cases apply
// For IPv6, the returned forms conform to RFC 4291 and RFC 5952.
func (ip IP) String() string {
p := ip