From 2c35def7efab9b8305487c23cb0575751642ce1e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 24 Jan 2024 22:15:19 +0100 Subject: [PATCH] net/netip: use Addr.appendTo4In6 in Addr.AppendTo Change-Id: Ieb1931c40b37b87fc7d0011461d9f583e73aaff9 Reviewed-on: https://go-review.googlesource.com/c/go/+/557778 Auto-Submit: Tobias Klauser LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui Reviewed-by: Damien Neil --- src/net/netip/netip.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/net/netip/netip.go b/src/net/netip/netip.go index 5c0c7afd97fae..1494fb2413f0b 100644 --- a/src/net/netip/netip.go +++ b/src/net/netip/netip.go @@ -773,13 +773,7 @@ func (ip Addr) AppendTo(b []byte) []byte { return ip.appendTo4(b) default: if ip.Is4In6() { - b = append(b, "::ffff:"...) - b = ip.Unmap().appendTo4(b) - if z := ip.Zone(); z != "" { - b = append(b, '%') - b = append(b, z...) - } - return b + return ip.appendTo4In6(b) } return ip.appendTo6(b) }