2021-12-03 03:44:21 +01:00
|
|
|
package utils
|
|
|
|
|
2022-11-12 20:37:20 +01:00
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
)
|
2021-12-03 03:44:21 +01:00
|
|
|
|
2022-11-12 20:37:20 +01:00
|
|
|
func TrimHostPort(host string) string {
|
|
|
|
i := strings.IndexByte(host, ':')
|
2021-12-03 03:44:21 +01:00
|
|
|
if i >= 0 {
|
|
|
|
return host[:i]
|
|
|
|
}
|
|
|
|
return host
|
|
|
|
}
|