netaddr: plans for API changes after Go 1.18 net/netip
mdlayher opened this issue · 3 comments
@terinjokes brought up a good point today on my Twitch stream (hi chat!):
Will package netaddr
be updated to use type aliases for net/netip
as of Go 1.18? Perhaps we use build tags or similar to ease transition for folks who are stuck on 1.17 or older?
I don't have strong feelings at the moment but it seems like a good idea to start thinking about at least. I know there is some functionality in this package such as IP sets and ranges that did not make it into the stdlib as of yet. It seems like it would make sense to keep those around here, perhaps backed by type aliases into stdlib.
Unfortunately, it's not just types; the API changed a bit as well. We should figure out a transition plan, though, yes. @bradfitz had opinions about this, I think. And yes, netaddr will live on for IPSet and IPRange.
Not really, other than netaddr having more API to do other things.
what might be missing is the way to convert netaddr.IP
to netip.Addr
and back.
we have net.IP
and netaddr.IP
in our codebase, but I would rather converge around netip.Addr
now and use netaddr.IP
for additional features (e.g. IPSet)