18 lines
225 B
Go
18 lines
225 B
Go
package utils
|
|
|
|
import "net/url"
|
|
|
|
type website struct{}
|
|
|
|
func WebSite() website {
|
|
return website{}
|
|
}
|
|
func (website) GetHost(addr string) string {
|
|
uu, err := url.Parse(addr)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
|
|
return uu.Host
|
|
}
|