From 0e0d9e492f692b6b0306cbc3cf2919456f24b9d3 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Thu, 7 Sep 2017 18:41:36 -0700 Subject: [PATCH] lease: use time.Until in 'Remaining' Fix 'gosimple' warnings. Signed-off-by: Gyu-Ho Lee --- lease/lessor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lease/lessor.go b/lease/lessor.go index 846c3612f..29a012416 100644 --- a/lease/lessor.go +++ b/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 {