Skip to content
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

net: add IP.IsPrivate #42793

Closed
wants to merge 1 commit into from
Closed

Conversation

6543
Copy link
Contributor

@6543 6543 commented Nov 24, 2020

Adds a new method IsPrivate to check if an IP is
private according to RFC 1918 & RFC 4193.

Fixes #29146

@google-cla
Copy link

google-cla bot commented Nov 24, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no Used by googlebot to label PRs as having an invalid CLA. The text of this label should not change. label Nov 24, 2020
@6543
Copy link
Contributor Author

6543 commented Nov 24, 2020

creddits to @MaxSem as I used your pull (#30278) as template :)

I would mention you in the comment but it does not look like souch information is wantend in the commit history so I leave it out...

@google-cla google-cla bot added cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. and removed cla: no Used by googlebot to label PRs as having an invalid CLA. The text of this label should not change. labels Nov 24, 2020
@gopherbot
Copy link
Contributor

This PR (HEAD: c73fccc) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/272668 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
A maintainer will review your change and provide feedback. See
https://golang.org/doc/contribute.html#review for more info and tips to get your
patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11 or adds a tag like "wait-release", it means that this CL will be
reviewed as part of the next development cycle. See https://golang.org/s/release
for more details.


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from 6543:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@bl-ue
Copy link

bl-ue commented Dec 19, 2020

Any progress on the fantastic feature??

@6543
Copy link
Contributor Author

6543 commented Jan 3, 2021

@bl-ue feature-freeze (this pull will go into 1.17, if all works well)

@bl-ue
Copy link

bl-ue commented Jan 3, 2021

Thank you @6543! I love this feature and can't wait for 1.17.

src/net/ip_test.go Outdated Show resolved Hide resolved
@gopherbot
Copy link
Contributor

This PR (HEAD: 70091ec) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/272668 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: bb09bf6) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/272668 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: 29178a0) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/272668 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: b0729da) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/272668 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 5: Run-TryBot+1

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 5:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=e4601796


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 5:

Build is still in progress...
This change failed on linux-amd64-race:
See https://storage.googleapis.com/go-build-log/e4601796/linux-amd64-race_bce4afaa.log

Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 5: TryBot-Result-1

1 of 21 TryBots failed:
Failed on linux-amd64-race: https://storage.googleapis.com/go-build-log/e4601796/linux-amd64-race_bce4afaa.log

Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed.


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 5: Code-Review+2


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 1c40030) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/272668 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from 6543:

Patch Set 7:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Emmanuel Odeke:

Patch Set 7: Run-TryBot+1

(4 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 7:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=e42efd82


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 7: TryBot-Result+1

TryBots are happy.


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: ad0bdb4) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/272668 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from 6543:

Patch Set 8:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Emmanuel Odeke:

Patch Set 8:

Thanks, but I was requesting you add them inside the code and not in the Godoc which would be an unnecessary explanation for the regular consumer. The comment inside the code is for maintainers and others peering deep, please change to the prior suggestion and add them in the related code sections as I had exhibited.


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@odeke-em
Copy link
Member

@6543 please take a look at, and address the feedback that I provided, then we’ll be ready to go. Thank you.

@6543
Copy link
Contributor Author

6543 commented Mar 22, 2021

just had no time to allocate it to this :)
give me few minutes :)

Add IsPrivate() helper to check if an IP is private according to RFC 1918 & RFC 4193

Fixes golang#29146
@6543
Copy link
Contributor Author

6543 commented Mar 22, 2021

@odeke-em hope, I got it right this time 🚀

@gopherbot
Copy link
Contributor

Message from 6543:

Patch Set 8:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 09f4ba7) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/272668 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from 6543:

Patch Set 8:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Emmanuel Odeke:

Patch Set 10: Run-TryBot+1 Code-Review+2

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 10:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=f77a2cf4


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@odeke-em
Copy link
Member

@6543 you got it, congrats and thank you!

gopherbot pushed a commit that referenced this pull request Mar 22, 2021
Adds a new method IsPrivate to check if an IP is
private according to RFC 1918 & RFC 4193.

Fixes #29146

Change-Id: If77b9e1746d86029df66ae9f18437b1f65a18b59
GitHub-Last-Rev: 09f4ba7
GitHub-Pull-Request: #42793
Reviewed-on: https://go-review.googlesource.com/c/go/+/272668
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Go Bot <gobot@golang.org>
@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 10: TryBot-Result+1

TryBots are happy.


Please don’t reply on this GitHub thread. Visit golang.org/cl/272668.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/272668 has been merged.

@gopherbot gopherbot closed this Mar 22, 2021
@bl-ue
Copy link

bl-ue commented Mar 22, 2021

🎊 🎉 🚀

@6543 6543 deleted the net/IP.IsPrivate branch March 23, 2021 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

net: add IP.IsPrivate (RFC 1918 & RFC 4193)
5 participants