Actually, ParseAddrPort is needed, since we give ip:port.
This commit is contained in:
parent
114d3cc931
commit
e695becbcd
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user