Commit c804fd89 authored by Yuval Pavel Zholkover's avatar Yuval Pavel Zholkover Committed by Brad Fitzpatrick

net: update IP.MarshalText documentation regarding len(ip) == 0

Describe the difference from String encoding when len(ip) is zero.

Change-Id: Ia9b36b405d4fec3fee9a77498a839b6d90c2ec0d
Reviewed-on: https://go-review.googlesource.com/37379Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 8c664384
......@@ -340,7 +340,8 @@ func ipEmptyString(ip IP) string {
}
// MarshalText implements the encoding.TextMarshaler interface.
// The encoding is the same as returned by String.
// The encoding is the same as returned by String, with one exception:
// When len(ip) is zero, it returns an empty slice.
func (ip IP) MarshalText() ([]byte, error) {
if len(ip) == 0 {
return []byte(""), nil
......
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