func (ic *InstanceChooser) add(instance *skynet.ServiceInfo) { for _, in := range ic.instances { if in.GetConfigPath() == instance.GetConfigPath() { return } } ic.instances = append(ic.instances, instance) }
func (ic *InstanceChooser) remove(instance *skynet.ServiceInfo) { 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 } } }