1
0

Actually, ParseAddrPort is needed, since we give ip:port.

This commit is contained in:
Alexander Andreev 2023-05-27 19:30:28 +04:00
parent 114d3cc931
commit e695becbcd
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -45,12 +45,12 @@ func main() {
network = "unix" network = "unix"
defer os.Remove(*listenAddress) defer os.Remove(*listenAddress)
} else { } else {
ap, err := netip.ParseAddr(*listenAddress) ap, err := netip.ParseAddrPort(*listenAddress)
if err != nil { if err != nil {
log.Fatalln(err) log.Fatalln(err)
} }
if ap.Is4() { if ap.Addr().Is4() {
network = "tcp4" network = "tcp4"
} else { } else {
network = "tcp6" network = "tcp6"