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 }