From 905c5d6b820eee4643b9c33322be9d395319bd9d Mon Sep 17 00:00:00 2001 From: Wang Yiping Date: Tue, 17 Dec 2019 00:32:24 +0800 Subject: [PATCH] fix deleteLease --- subnet/watch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subnet/watch.go b/subnet/watch.go index 709f23cfb4..46f52e51f5 100644 --- a/subnet/watch.go +++ b/subnet/watch.go @@ -150,8 +150,8 @@ func (lw *leaseWatcher) remove(lease *Lease) Event { } func deleteLease(l []Lease, i int) []Lease { - l[i] = l[len(l)-1] - return l[:len(l)-1] + l = append(l[:i], l[i+1:]...) + return l } // WatchLease performs a long term watch of the given network's subnet lease