// Is4 reports whether ip is an IPv4 address.
//
-// It returns false for IP4-mapped IPv6 addresses. See IP.Unmap.
+// It returns false for IPv4-mapped IPv6 addresses. See IP.Unmap.
func (ip Addr) Is4() bool {
return ip.z == z4
}
)
// As16 returns the IP address in its 16-byte representation.
-// IPv4 addresses are returned in their IPv4-mapped IPv6 form.
+// IPv4 addresses are returned as IPv4-mapped IPv6 addresses.
// IPv6 addresses with zones are returned without their zone (use the
// Zone method to get it).
// The ip zero value returns all zeroes.
// - IPv6 with zone ("fe80:db8::1%eth0")
//
// Note that unlike package net's IP.String method,
-// IP4-mapped IPv6 addresses format with a "::ffff:"
+// IPv4-mapped IPv6 addresses format with a "::ffff:"
// prefix before the dotted quad.
func (ip Addr) String() string {
switch ip.z {
//
// If p and o are of different address families or either have a zero
// IP, it reports false. Like the Contains method, a prefix with an
-// IPv4-mapped IPv6 IP is still treated as an IPv6 mask.
+// IPv4-mapped IPv6 address is still treated as an IPv6 mask.
func (p Prefix) Overlaps(o Prefix) bool {
if !p.IsValid() || !o.IsValid() {
return false
{pfx("1::1/128"), pfx("2::2/128"), false},
{pfx("0100::0/8"), pfx("::1/128"), false},
- // IPv4-mapped IPv6 should not overlap with IPv4.
+ // IPv4-mapped IPv6 addresses should not overlap with IPv4.
{PrefixFrom(AddrFrom16(mustIP("1.2.0.0").As16()), 16), pfx("1.2.3.0/24"), false},
// Invalid prefixes