github.com/geph-official/geph2@v0.22.6-0.20210211030601-f527cb59b0df/cmd/geph-client/chinalist/check.go (about)

     1  package chinalist
     2  
     3  import "github.com/weppos/publicsuffix-go/publicsuffix"
     4  
     5  // IsChinese checks if a FQDN is Chinese.
     6  func IsChinese(fqdn string) bool {
     7  	dom, err := publicsuffix.Domain(fqdn)
     8  	if err != nil {
     9  		return false
    10  	}
    11  	return domainList[fqdn] || domainList[dom]
    12  }