mirror of
https://github.com/wweir/sower.git
synced 2024-04-21 12:42:15 +00:00
12 lines
226 B
Go
12 lines
226 B
Go
package util
|
|
|
|
import "net"
|
|
|
|
func WithDefaultPort(addr string, port string) (address, host string) {
|
|
host, _, err := net.SplitHostPort(addr)
|
|
if err != nil {
|
|
return net.JoinHostPort(addr, port), addr
|
|
}
|
|
return addr, host
|
|
}
|