func (ic *InstanceChooser) add(instance *service.Service) { for _, in := range ic.instances { if in.GetConfigPath() == instance.GetConfigPath() { return } } ic.instances = append(ic.instances, instance) }
func (ic *InstanceChooser) remove(instance *service.Service) { for i, in := range ic.instances { if in.GetConfigPath() == instance.GetConfigPath() { ic.instances[i] = ic.instances[len(ic.instances)-1] ic.instances = ic.instances[:len(ic.instances)-1] return } } }