Selaa lähdekoodia

lease: use time.Until in 'Remaining'

Fix 'gosimple' warnings.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Gyu-Ho Lee 8 vuotta sitten
vanhempi
commit
0e0d9e492f
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      lease/lessor.go

+ 1 - 1
lease/lessor.go

@@ -627,7 +627,7 @@ func (l *Lease) Remaining() time.Duration {
 	if l.expiry.IsZero() {
 		return time.Duration(math.MaxInt64)
 	}
-	return l.expiry.Sub(time.Now())
+	return time.Until(l.expiry)
 }
 
 type LeaseItem struct {