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.split_address returns first part of ip address as port when its missing from string #14909

Closed
daansystems opened this issue Jul 1, 2022 · 2 comments · Fixed by #22349
Closed
Assignees
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: vlib Bugs/feature requests, that are related to the vlib.

Comments

@daansystems
Copy link

daansystems commented Jul 1, 2022

\ \ / / | Welcome to the V REPL (for help with V itself, type exit , then run v help ).
\ / / | Note: the REPL is highly experimental. For best V experience, use a text editor,
\ / | save your code in a main.v file and execute: v run main.v
\ / | V 0.3.0 1b46383 . Use list to see the accumulated program so far.
__/ | Use Ctrl-C or exit to exit, or help to see other available commands.

import net
net.split_address('192.168.1.100')?
('192.168.1.100', 192)

@daansystems daansystems added the Bug This tag is applied to issues which reports bugs. label Jul 1, 2022
@emily33901
Copy link
Member

\ \ / / | Welcome to the V REPL (for help with V itself, type exit , then run v help ). \ / / | Note: the REPL is highly experimental. For best V experience, use a text editor, \ / | save your code in a main.v file and execute: v run main.v \ / | V 0.3.0 1b46383 . Use list to see the accumulated program so far. __/ | Use Ctrl-C or exit to exit, or help to see other available commands.

import net
net.split_address('192.168.1.100')?
('192.168.1.100', 192)

what do you expect it to do in this case? Panic or return ip, none or?

@daansystems
Copy link
Author

I would suggest 0

@felipensp felipensp self-assigned this Sep 28, 2024
@felipensp felipensp added Unit: vlib Bugs/feature requests, that are related to the vlib. Status: Confirmed This bug has been confirmed to be valid by a contributor. labels Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: vlib Bugs/feature requests, that are related to the vlib.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants