:toda:
This commit is contained in:
17
utils/website.go
Normal file
17
utils/website.go
Normal file
@@ -0,0 +1,17 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user