code: func remove(na, r *api.GenericResource) bool {
  	switch tr := r.Resource.(type) {
  	case *api.GenericResource_DiscreteResourceSpec:
  		if na.GetDiscreteResourceSpec() == nil {
  			return false // Type change, ignore
  		}
  
  		na.GetDiscreteResourceSpec().Value -= tr.DiscreteResourceSpec.Value
  		if na.GetDiscreteResourceSpec().Value <= 0 {
  			return true
  		}
  	case *api.GenericResource_NamedResourceSpec:
  		if na.GetNamedResourceSpec() == nil {
  			return false // Type change, ignore
  		}
  
  		if tr.NamedResourceSpec.Value != na.GetNamedResourceSpec().Value {
  			return false // not the right item, ignore
  		}
  
  		return true
  	}
  
  	return false
  }
docs: // Returns true if the element is to be removed from the list