@@ -117,7 +117,7 @@ type Cmdable interface {
117
117
Get (ctx context.Context , key string ) * StringCmd
118
118
GetRange (ctx context.Context , key string , start , end int64 ) * StringCmd
119
119
GetSet (ctx context.Context , key string , value interface {}) * StringCmd
120
- GetEX (ctx context.Context , key string , expiration time.Duration ) * StringCmd
120
+ GetEx (ctx context.Context , key string , expiration time.Duration ) * StringCmd
121
121
GetDel (ctx context.Context , key string ) * StringCmd
122
122
Incr (ctx context.Context , key string ) * IntCmd
123
123
IncrBy (ctx context.Context , key string , value int64 ) * IntCmd
@@ -127,6 +127,7 @@ type Cmdable interface {
127
127
MSetNX (ctx context.Context , values ... interface {}) * BoolCmd
128
128
Set (ctx context.Context , key string , value interface {}, expiration time.Duration ) * StatusCmd
129
129
SetArgs (ctx context.Context , key string , value interface {}, a SetArgs ) * StatusCmd
130
+ // TODO: rename to SetEx
130
131
SetEX (ctx context.Context , key string , value interface {}, expiration time.Duration ) * StatusCmd
131
132
SetNX (ctx context.Context , key string , value interface {}, expiration time.Duration ) * BoolCmd
132
133
SetXX (ctx context.Context , key string , value interface {}, expiration time.Duration ) * BoolCmd
@@ -714,9 +715,9 @@ func (c cmdable) GetSet(ctx context.Context, key string, value interface{}) *Str
714
715
return cmd
715
716
}
716
717
717
- // redis-server version >= 6.2.0 .
718
- // A expiration of zero remove the time to live associated with the key(GetEX key persist) .
719
- func (c cmdable ) GetEX (ctx context.Context , key string , expiration time.Duration ) * StringCmd {
718
+ // An expiration of zero removes the TTL associated with the key (i.e. GETEX key persist) .
719
+ // Requires Redis >= 6.2.0 .
720
+ func (c cmdable ) GetEx (ctx context.Context , key string , expiration time.Duration ) * StringCmd {
720
721
args := make ([]interface {}, 0 , 4 )
721
722
args = append (args , "getex" , key )
722
723
if expiration > 0 {
0 commit comments