wireguard-dashboard/utils/url.go

17 lines
234 B
Go
Raw Permalink Normal View History

package utils
import "net/url"
// GetHost
// @description: 获取指定地址的host
// @param addr
// @return string
func GetHost(addr string) string {
uu, err := url.Parse(addr)
if err != nil {
return ""
}
return uu.Host
}