diff options
| author | Josh Bleecher Snyder <josharian@gmail.com> | 2021-11-05 14:55:52 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2021-11-05 22:55:56 +0000 |
| commit | e83a2047e0332e45c20fb1bcdb984e9cc74ffb1f (patch) | |
| tree | 181571378bd9b33fbff147733b279b0c0b414d84 /src | |
| parent | ba79c1e24198c2222e3bfe350326a8962fee0441 (diff) | |
| download | go-e83a2047e0332e45c20fb1bcdb984e9cc74ffb1f.tar.xz | |
net/netip: document the zero Addr
Fixes #49364
Change-Id: I3372f80723a4deae48ef106f88b0ad880cdd0e45
Reviewed-on: https://go-review.googlesource.com/c/go/+/361914
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/net/netip/netip.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/net/netip/netip.go b/src/net/netip/netip.go index 1596acbb8e..01f6fe5efa 100644 --- a/src/net/netip/netip.go +++ b/src/net/netip/netip.go @@ -32,6 +32,9 @@ import ( // // Unlike net.IP or net.IPAddr, Addr is a comparable value // type (it supports == and can be a map key) and is immutable. +// +// The zero Addr is not a valid IP address. +// Addr{} is distinct from both 0.0.0.0 and ::. type Addr struct { // addr is the hi and lo bits of an IPv6 address. If z==z4, // hi and lo contain the IPv4-mapped IPv6 address. |
