code: func (m *Memberlist) Join(existing []string) (int, error) {
  	numSuccess := 0
  	var errs error
  	for _, exist := range existing {
  		addrs, err := m.resolveAddr(exist)
  		if err != nil {
  			err = fmt.Errorf("Failed to resolve %s: %v", exist, err)
  			errs = multierror.Append(errs, err)
  			m.logger.Printf("[WARN] memberlist: %v", err)
  			continue
  		}
  
  		for _, addr := range addrs {
  			hp := joinHostPort(addr.ip.String(), addr.port)
  			if err := m.pushPullNode(hp, true); err != nil {
  				err = fmt.Errorf("Failed to join %s: %v", addr.ip, err)
  				errs = multierror.Append(errs, err)
  				m.logger.Printf("[DEBUG] memberlist: %v", err)
  				continue
  			}
  			numSuccess++
  		}
  
  	}
  	if numSuccess > 0 {
  		errs = nil
  	}
  	return numSuccess, errs
  }
docs: // Join is used to take an existing Memberlist and attempt to join a cluster
  // by contacting all the given hosts and performing a state sync. Initially,
  // the Memberlist only contains our own state, so doing this will cause
  // remote nodes to become aware of the existence of this node, effectively
  // joining the cluster.
  //
  // This returns the number of hosts successfully contacted and an error if
  // none could be reached. If an error is returned, the node did not successfully
  // join the cluster.