code: func ParseFriendlyHost(source string) (host *FriendlyHost, rest string) {
  	parts := strings.SplitN(source, "/", 2)
  
  	if hostRe.MatchString(parts[0]) {
  		host = &FriendlyHost{Raw: parts[0]}
  		if len(parts) == 2 {
  			rest = parts[1]
  		}
  		return
  	}
  
  	// No match, return whole string as rest along with nil host
  	rest = source
  	return
  }
docs: // ParseFriendlyHost attempts to parse a valid "friendly host" prefix from the
  // given string. If no valid prefix is found, host will be nil and rest will
  // contain the full source string. The host prefix must terminate at the end of
  // the input or at the first / character. If one or more characters exist after
  // the first /, they will be returned as rest (without the / delimiter).
  // Hostnames containing punycode WILL be parsed successfully since they may have
  // come from an internal normalized source string, however should be considered
  // invalid if the string came from a user directly. This must be checked
  // explicitly for user-input strings by calling Valid() on the
  // returned host.