瀏覽代碼

lease: use time.Until in 'Remaining'

Fix 'gosimple' warnings.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Gyu-Ho Lee 8 年之前
父節點
當前提交
0e0d9e492f
共有 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 {