7// Network returns tcp4 or tcp6, depending on the ip.
8// This network can be passed to Listen instead of "tcp", which may start listening
9// on both ipv4 and ipv6 for addresses 0.0.0.0 and ::, which can lead to errors
10// about the port already being in use.
11// For invalid IPs, "tcp" is returned.
12func Network(ip string) string {