more string

This commit is contained in:
6543 2022-08-28 16:21:37 +02:00
parent 662d76386c
commit 51ca74fc11
No known key found for this signature in database
GPG key ID: C99B82E40B027BAE
16 changed files with 121 additions and 123 deletions

View file

@ -1,9 +1,11 @@
package utils
import "bytes"
import (
"strings"
)
func TrimHostPort(host []byte) []byte {
i := bytes.IndexByte(host, ':')
func TrimHostPort(host string) string {
i := strings.IndexByte(host, ':')
if i >= 0 {
return host[:i]
}