code: func (ep *multiPortEndpoint) unregisterEndpoint(t TransportEndpoint) bool {
  	ep.mu.Lock()
  	defer ep.mu.Unlock()
  
  	idx, ok := ep.endpointsMap[t]
  	if !ok {
  		return false
  	}
  	delete(ep.endpointsMap, t)
  	l := len(ep.endpointsArr)
  	if l > 1 {
  		// The last endpoint in endpointsArr is moved instead of the deleted one.
  		lastEp := ep.endpointsArr[l-1]
  		ep.endpointsArr[idx] = lastEp
  		ep.endpointsMap[lastEp] = idx
  		ep.endpointsArr = ep.endpointsArr[0 : l-1]
  		return false
  	}
  	return true
  }
docs: // unregisterEndpoint returns true if multiPortEndpoint has to be unregistered.