Skip to content

Commit 34d9a7a

Browse files
committed
update a comment
There was an issue with confusion about this a while ago.
1 parent 6fbbe6e commit 34d9a7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

direct.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,8 @@ func (db *RedisDB) Unlink(k string) bool {
390390

391391
// TTL is the left over time to live. As set via EXPIRE, PEXPIRE, EXPIREAT,
392392
// PEXPIREAT.
393-
// 0 if not set.
393+
// Note: this direct function returns 0 if there is no TTL set, unlike redis,
394+
// which returns -1.
394395
func (m *Miniredis) TTL(k string) time.Duration {
395396
return m.DB(m.selectedDB).TTL(k)
396397
}

0 commit comments

Comments
 (0)