From 692e81356831421265c413ab55425c940b445e6e Mon Sep 17 00:00:00 2001 From: Pera Jovic Date: Fri, 28 Feb 2020 14:11:15 +0100 Subject: [PATCH] Fix mock for cache TTL method --- cache/cachemock/cache.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cache/cachemock/cache.go b/cache/cachemock/cache.go index 204d1af..50657b4 100644 --- a/cache/cachemock/cache.go +++ b/cache/cachemock/cache.go @@ -92,11 +92,7 @@ func (m *Cache) SetInt(key string, value int64, expiration time.Duration) error func (m *Cache) TTL(key string) (time.Duration, error) { args := m.Called(key) - if args.Get(0) != nil { - return args.Get(0).(time.Duration), args.Error(1) - } - - return 0, args.Error(1) + return args.Get(0).(time.Duration), args.Error(1) } // SetJSON is a mock implementation of cache.Cache#SetJSON.