Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naming inconsistency: FCallRo vs EvalRO, EvalShaRO, SortRO #2545

Closed
alex9801 opened this issue Apr 11, 2023 · 1 comment · Fixed by #2550
Closed

Naming inconsistency: FCallRo vs EvalRO, EvalShaRO, SortRO #2545

alex9801 opened this issue Apr 11, 2023 · 1 comment · Fixed by #2550

Comments

@alex9801
Copy link

Support for FCALL_RO command was added in version 9.0.3 with the name FCallRo().
https://pkg.go.dev/github.com/redis/go-redis/v9@v9.0.3#Client.FCallRo

However, other read-only commands are named with ~RO() convention. (e.g. EvalRO(), EvalShaRO(), SortRO())
https://pkg.go.dev/github.com/redis/go-redis/v9@v9.0.3#Client.EvalRO
https://pkg.go.dev/github.com/redis/go-redis/v9@v9.0.3#Client.EvalShaRO
https://pkg.go.dev/github.com/redis/go-redis/v9@v9.0.3#Client.SortRO

The slight naming inconsistency here could be surprising to users, especially for people migrating their code from using EVAL(SHA)_RO to FCALL_RO.

One possible solution could be adding FCallRO() and deprecating FCallRo().

@monkey92t
Copy link
Collaborator

Yes, you are right, it is short for ReadOnly, we should name it RO instead of Ro, we ignore this...

But according to go mod specifications, we should maintain compatibility with 9.0.3, we can consider adding a new API, such as FCallRO, and mark FCallRo as deprecated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants