Skip to content

Commit b64f087

Browse files
committed
Adjust KeepTTL annotation.
Signed-off-by: monkey92t <[email protected]>
1 parent 960e4d6 commit b64f087

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

commands.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"github.com/go-redis/redis/v8/internal"
1010
)
1111

12-
// KeepTTL is an option for Set command to keep key's existing TTL.
13-
// It requires your redis-server version >= 6.0 (Otherwise you will receive an error: (error) ERR syntax error).
12+
// KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,
13+
// otherwise you will receive an error: (error) ERR syntax error.
1414
// For example:
1515
//
1616
// rdb.Set(ctx, key, value, redis.KeepTTL)
@@ -841,8 +841,8 @@ func (c cmdable) MSetNX(ctx context.Context, values ...interface{}) *BoolCmd {
841841
// Use expiration for `SETEX`-like behavior.
842842
//
843843
// Zero expiration means the key has no expiration time.
844-
// KeepTTL(-1) expiration is a Redis KEEPTTL option to keep existing TTL.
845-
// It requires your redis-server version >= 6.0 (Otherwise you will receive an error: (error) ERR syntax error).
844+
// KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,
845+
// otherwise you will receive an error: (error) ERR syntax error.
846846
func (c cmdable) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd {
847847
args := make([]interface{}, 3, 5)
848848
args[0] = "set"
@@ -875,8 +875,8 @@ type SetArgs struct {
875875
// When Get is true, the command returns the old value stored at key, or nil when key did not exist.
876876
Get bool
877877

878-
// KeepTTL is a Redis KEEPTTL option to keep existing TTL.
879-
// It requires your redis-server version >= 6.0 (Otherwise you will receive an error: (error) ERR syntax error).
878+
// KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,
879+
// otherwise you will receive an error: (error) ERR syntax error.
880880
KeepTTL bool
881881
}
882882

@@ -924,8 +924,8 @@ func (c cmdable) SetEX(ctx context.Context, key string, value interface{}, expir
924924
// SetNX Redis `SET key value [expiration] NX` command.
925925
//
926926
// Zero expiration means the key has no expiration time.
927-
// KeepTTL(-1) expiration is a Redis KEEPTTL option to keep existing TTL.
928-
// It requires your redis-server version >= 6.0 (Otherwise you will receive an error: (error) ERR syntax error).
927+
// KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,
928+
// otherwise you will receive an error: (error) ERR syntax error.
929929
func (c cmdable) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd {
930930
var cmd *BoolCmd
931931
switch expiration {
@@ -949,8 +949,8 @@ func (c cmdable) SetNX(ctx context.Context, key string, value interface{}, expir
949949
// SetXX Redis `SET key value [expiration] XX` command.
950950
//
951951
// Zero expiration means the key has no expiration time.
952-
// KeepTTL(-1) expiration is a Redis KEEPTTL option to keep existing TTL.
953-
// It requires your redis-server version >= 6.0 (Otherwise you will receive an error: (error) ERR syntax error).
952+
// KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,
953+
// otherwise you will receive an error: (error) ERR syntax error.
954954
func (c cmdable) SetXX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd {
955955
var cmd *BoolCmd
956956
switch expiration {

0 commit comments

Comments
 (0)