Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Domain ¶
Domain returns top level domain from url string. If no domain is found in provided url, this function returns empty string. If no TLD is found in provided url, this function returns empty string.
Example ¶
fmt.Println(Domain("google.co.uk")) fmt.Println(Domain("keep.google.com"))
Output: google.co.uk google.com
func DomainSuffix ¶
DomainSuffix returns domain suffix from provided url. If no TLD is found in provided url, this function returns empty string.
Example ¶
fmt.Println(DomainSuffix("google.co.uk")) fmt.Println(DomainSuffix("keep.google.com"))
Output: co.uk com
func HasSubdomain ¶
HasSubdomain reports whether domain contains any subdomain.
Example ¶
fmt.Println(HasSubdomain("google.com")) fmt.Println(HasSubdomain("keep.google.com"))
Output: false true
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.