v
v copied to clipboard
net.split_address returns first part of ip address as port when its missing from string
\ \ / / | 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)
\ \ / / | 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?
I would suggest 0