Fun fact: there is no standard way to compare or sort IP subnets up to Go 1.25.
When the Go team initially designed the IP subnet type (netip.Prefix), they chose not to add a Compare method because there wasn't a widely accepted way to order these values.
Over time, they changed their minds. Go 1.26 will bring order to the IP subnets in the same way Python's "netaddr" package does. It also matches the conventional order used by IANA.
antonz.org/accepted/netip-pr…
Oct 20, 2025 · 9:12 AM UTC

