@@ -117,7 +117,7 @@ type Cmdable interface {
117117 Get (ctx context.Context , key string ) * StringCmd
118118 GetRange (ctx context.Context , key string , start , end int64 ) * StringCmd
119119 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
121121 GetDel (ctx context.Context , key string ) * StringCmd
122122 Incr (ctx context.Context , key string ) * IntCmd
123123 IncrBy (ctx context.Context , key string , value int64 ) * IntCmd
@@ -127,6 +127,7 @@ type Cmdable interface {
127127 MSetNX (ctx context.Context , values ... interface {}) * BoolCmd
128128 Set (ctx context.Context , key string , value interface {}, expiration time.Duration ) * StatusCmd
129129 SetArgs (ctx context.Context , key string , value interface {}, a SetArgs ) * StatusCmd
130+ // TODO: rename to SetEx
130131 SetEX (ctx context.Context , key string , value interface {}, expiration time.Duration ) * StatusCmd
131132 SetNX (ctx context.Context , key string , value interface {}, expiration time.Duration ) * BoolCmd
132133 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
714715 return cmd
715716}
716717
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 {
720721 args := make ([]interface {}, 0 , 4 )
721722 args = append (args , "getex" , key )
722723 if expiration > 0 {
0 commit comments