inetaf / netaddr

Network address types
BSD 3-Clause "New" or "Revised" License
715 stars 39 forks source link

netaddr: plans for API changes after Go 1.18 net/netip #217

Open mdlayher opened 2 years ago

mdlayher commented 2 years ago

@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.

/cc @bradfitz @danderson @josharian

josharian commented 2 years ago

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.

bradfitz commented 2 years ago

Not really, other than netaddr having more API to do other things.

smira commented 2 years ago

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)