From 9911eda98e004b72623a81e8aa8bc8b7d9dab4a6 Mon Sep 17 00:00:00 2001 From: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com> Date: Mon, 17 Apr 2023 12:10:35 +0530 Subject: [PATCH 1/3] Deprecated FCallRo --- commands.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/commands.go b/commands.go index 588b3a4f5..f552757af 100644 --- a/commands.go +++ b/commands.go @@ -451,6 +451,7 @@ type Cmdable interface { FunctionStats(ctx context.Context) *FunctionStatsCmd FCall(ctx context.Context, function string, keys []string, args ...interface{}) *Cmd FCallRo(ctx context.Context, function string, keys []string, args ...interface{}) *Cmd + FCallRO(ctx context.Context, function string, keys []string, args ...interface{}) *Cmd Publish(ctx context.Context, channel string, message interface{}) *IntCmd SPublish(ctx context.Context, channel string, message interface{}) *IntCmd @@ -3494,6 +3495,8 @@ func (c cmdable) FCall(ctx context.Context, function string, keys []string, args _ = c(ctx, cmd) return cmd } + +// Deprecated to maintain convention FCallRO func (c cmdable) FCallRo(ctx context.Context, function string, keys []string, args ...interface{}) *Cmd { cmdArgs := fcallArgs("fcall_ro", function, keys, args...) cmd := NewCmd(ctx, cmdArgs...) @@ -3504,6 +3507,16 @@ func (c cmdable) FCallRo(ctx context.Context, function string, keys []string, ar return cmd } +func (c cmdable) FCallRO(ctx context.Context, function string, keys []string, args ...interface{}) *Cmd { + cmdArgs := fcallArgs("fcall_ro", function, keys, args...) + cmd := NewCmd(ctx, cmdArgs...) + if len(keys) > 0 { + cmd.SetFirstKeyPos(3) + } + _ = c(ctx, cmd) + return cmd +} + func fcallArgs(command string, function string, keys []string, args ...interface{}) []interface{} { cmdArgs := make([]interface{}, 3+len(keys), 3+len(keys)+len(args)) cmdArgs[0] = command From a4383ddca4f60466ee63ec4c1ba66ee10f35a453 Mon Sep 17 00:00:00 2001 From: monkey92t Date: Mon, 17 Apr 2023 22:14:07 +0800 Subject: [PATCH 2/3] feat: FCallRo to FCallRO Signed-off-by: monkey92t --- commands.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/commands.go b/commands.go index f552757af..d9ffb75b1 100644 --- a/commands.go +++ b/commands.go @@ -3496,15 +3496,9 @@ func (c cmdable) FCall(ctx context.Context, function string, keys []string, args return cmd } -// Deprecated to maintain convention FCallRO +// FCallRo Deprecated to maintain convention FCallRO, this function simply calls FCallRO func (c cmdable) FCallRo(ctx context.Context, function string, keys []string, args ...interface{}) *Cmd { - cmdArgs := fcallArgs("fcall_ro", function, keys, args...) - cmd := NewCmd(ctx, cmdArgs...) - if len(keys) > 0 { - cmd.SetFirstKeyPos(3) - } - _ = c(ctx, cmd) - return cmd + return c.FCallRO(ctx, function, keys, args...) } func (c cmdable) FCallRO(ctx context.Context, function string, keys []string, args ...interface{}) *Cmd { From bee53ffd17bc944b8fe30b2e94160f4fe2216916 Mon Sep 17 00:00:00 2001 From: monkey92t Date: Tue, 18 Apr 2023 01:00:01 +0800 Subject: [PATCH 3/3] update doc Signed-off-by: monkey92t --- commands.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 525270f3b..c94ccdfe5 100644 --- a/commands.go +++ b/commands.go @@ -3497,7 +3497,8 @@ func (c cmdable) FCall(ctx context.Context, function string, keys []string, args return cmd } -// FCallRo Deprecated to maintain convention FCallRO, this function simply calls FCallRO +// FCallRo this function simply calls FCallRO, +// Deprecated: to maintain convention FCallRO. func (c cmdable) FCallRo(ctx context.Context, function string, keys []string, args ...interface{}) *Cmd { return c.FCallRO(ctx, function, keys, args...) }