-
Notifications
You must be signed in to change notification settings - Fork 188
Tools to check IPv4 or IPv6 input #165
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
Tools to check IPv4 or IPv6 input #165
Conversation
|
@UmanShahzad Please check. |
UmanShahzad
left a comment
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.
Do fix issues commonly found in the other PRs that also appear here, then do ping me again @Kashaf-Sajid-Yaseen @awaismslm
|
@UmanShahzad Please check. |
UmanShahzad
left a comment
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.
Few things:
- Ensure we dont use underscores in the name of Golang functions. In the subcommand name itself it's fine but not in golang code.
- For printing, we should just print
<ip>,trueor<ip>,falsefor now instead of the full sentences of<ip> is na IPv4 input - Can we develop helper functions to check if the IP or IPNet (cidr) is v4/v6? Too many inlined conditionals are being used which makes it harder to read and reuse.
ipinfo/cmd_tool.go
Outdated
| case cmd == "is_v4": | ||
| err = cmdToolIs_v4() | ||
| case cmd == "is_v6": | ||
| err = cmdToolIs_v6() |
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.
Func name should be cmdToolIsV6 (Similar for v4), even though the actual subcmd has an underscore.
ipinfo/cmd_tool_is_v6.go
Outdated
| Examples: | ||
| # Check CIDR. | ||
| $ %[1]s tool is_v6 1.1.1.0/30 |
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.
Can we give a real v6 example
|
@UmanShahzad Please check. |
Tools to check the type of input (IPv4 & IPv6) entered by the user.