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

IsInternal function #20

Merged
merged 10 commits into from
Nov 14, 2022
Merged

IsInternal function #20

merged 10 commits into from
Nov 14, 2022

Conversation

xm1k3
Copy link
Contributor

@xm1k3 xm1k3 commented Nov 14, 2022

The IsInternal function checks if an IP address is internal, it works on both ipv4 and ipv6 addresses

@xm1k3 xm1k3 marked this pull request as ready for review November 14, 2022 10:29
@xm1k3 xm1k3 requested a review from Mzack9999 November 14, 2022 10:29
@Mzack9999 Mzack9999 linked an issue Nov 14, 2022 that may be closed by this pull request
@Mzack9999 Mzack9999 added the Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity. label Nov 14, 2022
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please have a look at my comments

ip/iputil.go Outdated Show resolved Hide resolved
ip/iputil.go Outdated Show resolved Hide resolved
ip/iputil.go Outdated Show resolved Hide resolved
ip/iputil.go Outdated Show resolved Hide resolved
@xm1k3 xm1k3 requested a review from Mzack9999 November 14, 2022 13:31
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested changes:

  • Looks like the struct can be removed
  • ipv4,ipv6 can be populated at init
  • log.Fatal => panic (legitimate)
  • IsInternal can use directly ipv4 and ipv6

@xm1k3 xm1k3 requested a review from Mzack9999 November 14, 2022 15:42
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug instructions to remove

ip/iputil.go Outdated Show resolved Hide resolved
ip/iputil.go Outdated Show resolved Hide resolved
@Mzack9999 Mzack9999 self-requested a review November 14, 2022 18:51
@Mzack9999 Mzack9999 merged commit ba8c203 into main Nov 14, 2022
@Mzack9999 Mzack9999 deleted the check-internal-ips branch November 14, 2022 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Maintenance Updating phrasing or wording to make things clearer or removing ambiguity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IsInternal(str string)
2 participants