netaddr icon indicating copy to clipboard operation
netaddr copied to clipboard

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

Open mdlayher opened this issue 3 years ago • 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.

/cc @bradfitz @danderson @josharian

mdlayher avatar Jan 12 '22 19:01 mdlayher

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.

josharian avatar Jan 12 '22 20:01 josharian

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

bradfitz avatar Apr 15 '22 15:04 bradfitz

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)

smira avatar May 24 '22 13:05 smira