code: func resolveServerHostPort(servername string, existingServers []services.Server) (string, int, error) {
  	// If port is 0, client wants us to figure out which port to use.
  	var defaultPort = 0
  
  	if servername == "" {
  		return "", defaultPort, trace.BadParameter("empty server name")
  	}
  
  	// Check if servername is UUID.
  	for i := range existingServers {
  		node := existingServers[i]
  		if node.GetName() == servername {
  			return node.GetHostname(), defaultPort, nil
  		}
  	}
  
  	if !strings.Contains(servername, ":") {
  		return servername, defaultPort, nil
  	}
  
  	// Check for explicitly specified port.
  	host, portString, err := utils.SplitHostPort(servername)
  	if err != nil {
  		return "", defaultPort, trace.Wrap(err)
  	}
  
  	port, err := strconv.Atoi(portString)
  	if err != nil {
  		return "", defaultPort, trace.BadParameter("invalid port: %v", err)
  	}
  
  	return host, port, nil
  }
docs: // resolveServerHostPort parses server name and attempts to resolve hostname
  // and port.