pages-server/server/utils/utils.go

14 lines
162 B
Go
Raw Normal View History

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