Hacker News new | ask | show | jobs
by wjholden 637 days ago
Fun fact: in Go, an IPv4 address is internally represented as an IPv6 address, starting with ten zeroes and two 0xffs. The IPv4 address is copied in the last four bytes.

https://cs.opensource.google/go/go/+/refs/tags/go1.23.1:src/...

This is called an IPv4-Mapped Address.

https://www.rfc-editor.org/rfc/rfc5156#section-2.2