move helper func in related packages

This commit is contained in:
6543
2021-12-03 03:44:21 +01:00
parent 5b81a8b8bc
commit 690879440a
6 changed files with 66 additions and 54 deletions

11
server/utils/utils.go Normal file
View File

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