code: func compareHosts(searchHostname, configHostname string) int {
  	searchHost := strings.Split(searchHostname, ".")
  	configHost := strings.Split(configHostname, ".")
  
  	if len(searchHost) != len(configHost) {
  		return 0
  	}
  
  	score := len(searchHost) + 1
  
  	for i, subdomain := range searchHost {
  		if configHost[i] == "*" {
  			score--
  			continue
  		}
  
  		if subdomain != configHost[i] {
  			return 0
  		}
  	}
  
  	return score
  }
docs: // compareHosts compares a hostname with a configuration hostname to determine
  // a match. It returns an integer indicating the strength of the match, or 0 if
  // the two hostnames did not match.