code: func (r *Router) RemoveServer(areaID types.AreaID, s *metadata.Server) error {
  	r.Lock()
  	defer r.Unlock()
  
  	area, ok := r.areas[areaID]
  	if !ok {
  		return fmt.Errorf("area ID %q does not exist", areaID)
  	}
  
  	// If the manager has already been removed we just quietly exit. This
  	// can get called by Serf events, so the timing isn't totally
  	// deterministic.
  	info, ok := area.managers[s.Datacenter]
  	if !ok {
  		return nil
  	}
  	info.manager.RemoveServer(s)
  
  	// If this manager is empty then remove it so we don't accumulate cruft
  	// and waste time during request routing.
  	if num := info.manager.NumServers(); num == 0 {
  		r.removeManagerFromIndex(s.Datacenter, info.manager)
  		close(info.shutdownCh)
  		delete(area.managers, s.Datacenter)
  	}
  
  	return nil
  }
docs: // RemoveServer should be called whenever a server is removed from an area. This
  // is typically hooked into the Serf event handler area for this area.