-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg/net: replace net with net/netip #2706
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Overall looks good.
I think it's fine to update the tests to expect the new error strings. We exposed the net
errors as-is from Go, so if we switch to net/netip
, we should continue to do that for the new package. If we wanted the errors to be particular to CUE, or stable over time, we would have to filter or replace all error values, but we don't really do or need to.
9e031fb
to
ee61020
Compare
Cheers @mvdan. I've updated the tests and amended the commit to rely on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM with some thoughts about the ParsePrefix error handling.
ee61020
to
68fb22b
Compare
This replaces the go net package with net/netip as the latter is a better alternative and supports IPv6 checks. Updates cue-lang#2614 Signed-off-by: Martin Greber <[email protected]>
68fb22b
to
1dfc0e7
Compare
BTW, I'll get a PR ready for the Cue |
Thank you! I'll be importing this PR to Gerrit now for merging, since GitHub is simply a git mirror for Gerrit. If you want to send further changes, I'd suggest sending them straight to Gerrit, for the sake of avoiding this extra step and speeding up the process :) https://github.com/cue-lang/cue/blob/master/CONTRIBUTING.md#preparing-for-gerrithub-cl-contributions And yes, definitely agreed that we can add the new API as a separate contribution. |
Imported as https://review.gerrithub.io/c/cue-lang/cue/+/1173735. I also added a brief note to the commit message clarifying what changes the user might see from this switch. |
This replaces the go net package with net/netip as the latter is a better alternative and supports IPv6 checks.
Updates #2614