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

Add helpers to set libinfo without panic #2724

Merged

Conversation

peczenyj
Copy link
Contributor

@peczenyj peczenyj commented Sep 21, 2023

Hello

the command CLIENT SETINFO expects lib name OR lib version and it we try to set both (or none) it will fail

to avoid this I add two small helpers that can return a valid LibraryInfo struct that will never panics and it make the code readable (please check the examples)

I did not add any breaking changes, just two new functions: WithLibraryName and WithLibraryVersion -- we can rename it if you want.

I think this can mitigate any possible panic in runtime.

Regards

ofekshenawa
ofekshenawa previously approved these changes Dec 17, 2023
@ofekshenawa ofekshenawa merged commit 21ed15b into redis:master Feb 14, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants