From 2f775b91b1871aa2eacdb19ead52f8801ba75b29 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 15 Dec 2019 15:52:49 +0100 Subject: [PATCH] nsscash: main_test: use time.Since() --- main_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/main_test.go b/main_test.go index 145abe9..ffb176f 100644 --- a/main_test.go +++ b/main_test.go @@ -166,8 +166,7 @@ func mustBeOld(t *testing.T, paths ...string) { } mtime := i.ModTime() - now := time.Now() - if now.Sub(mtime) < time.Hour { + if time.Since(mtime) < time.Hour { t.Errorf("%q was recently modified", p) } } @@ -182,8 +181,7 @@ func mustBeNew(t *testing.T, paths ...string) { } mtime := i.ModTime() - now := time.Now() - if now.Sub(mtime) > time.Hour { + if time.Since(mtime) > time.Hour { t.Errorf("%q was not recently modified", p) } } -- 2.45.2