Просмотр исходного кода

Merge pull request #8522 from gyuho/lessor

lease: use time.Until in 'Remaining'
Gyu-Ho Lee 8 лет назад
Родитель
Сommit
70c20a9e73
1 измененных файлов с 1 добавлено и 1 удалено
  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 {