code: func (n *Node) applyRemoveNode(ctx context.Context, cc raftpb.ConfChange) (err error) {
  	// If the node from where the remove is issued is
  	// a follower and the leader steps down, Campaign
  	// to be the leader.
  
  	if cc.NodeID == n.leader() && !n.isLeader() {
  		if err = n.raftNode.Campaign(ctx); err != nil {
  			return err
  		}
  	}
  
  	if cc.NodeID == n.Config.ID {
  		// wait for the commit ack to be sent before closing connection
  		n.asyncTasks.Wait()
  
  		n.NodeRemoved()
  	} else if err := n.transport.RemovePeer(cc.NodeID); err != nil {
  		return err
  	}
  
  	return n.cluster.RemoveMember(cc.NodeID)
  }
docs: // applyRemoveNode is called when we receive a ConfChange
  // from a member in the raft cluster, this removes a node
  // from the existing raft cluster