Skip to content

Commit

Permalink
net/netip: use Addr.appendTo4In6 in Addr.AppendTo
Browse files Browse the repository at this point in the history
Change-Id: Ieb1931c40b37b87fc7d0011461d9f583e73aaff9
Reviewed-on: https://go-review.googlesource.com/c/go/+/557778
Auto-Submit: Tobias Klauser <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
Reviewed-by: Damien Neil <[email protected]>
  • Loading branch information
tklauser authored and gopherbot committed Jan 24, 2024
1 parent 4f4d650 commit 2c35def
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/net/netip/netip.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 2c35def

Please sign in to comment.