code: func ParseHostPort(hostport string) (string, string, error) {
  	var host, port string
  	var err error
  
  	// try to split host and port
  	if host, port, err = net.SplitHostPort(hostport); err != nil {
  		// if SplitHostPort returns an error, the entire hostport is considered as host
  		host = hostport
  	}
  
  	// if port is defined, parse and validate it
  	if port != "" {
  		if _, err := ParsePort(port); err != nil {
  			return "", "", errors.Errorf("hostport %s: port %s must be a valid number between 1 and 65535, inclusive", hostport, port)
  		}
  	}
  
  	// if host is a valid IP, returns it
  	if ip := net.ParseIP(host); ip != nil {
  		return host, port, nil
  	}
  
  	// if host is a validate RFC-1123 subdomain, returns it
  	if errs := validation.IsDNS1123Subdomain(host); len(errs) == 0 {
  		return host, port, nil
  	}
  
  	return "", "", errors.Errorf("hostport %s: host '%s' must be a valid IP address or a valid RFC-1123 DNS subdomain", hostport, host)
  }
docs: // ParseHostPort parses a network address of the form "host:port", "ipv4:port", "[ipv6]:port" into host and port;
  // ":port" can be eventually omitted.
  // If the string is not a valid representation of network address, ParseHostPort returns an error.