func removeInstanceFromLB(lb *elb.LoadBalancerDescription, id string) { index := -1 for i, instance := range lb.Instances { if instance.InstanceId == id { index = i break } } if index > -1 { copy(lb.Instances[index:], lb.Instances[index+1:]) lb.Instances = lb.Instances[:len(lb.Instances)-1] } }