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.