Repository navigation
fix(rueidiscompat): reject unsupported slice fields - #1031
Closed
fallintoplace wants to merge 1 commit into
Closed
fallintoplace wants to merge 1 commit into
fallintoplace wants to merge 1 commit into
Conversation
Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
Collaborator
|
Hi @fallintoplace, why do you need this? This doesn't seem to align with go-redis. |
Author
|
I think you are right, I will close this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Scan.Why
[]intkeeps its old value whileScanreturns success.Implementation
Note
Medium Risk
Changes
Scanfrom silent no-op to error for many slice field types, which may surface latent misuse but fixes incorrect success semantics.Overview
Scanno longer reports success for slice fields it cannot decode. Only[]byte/[]uint8still get the Redis string as raw bytes; other slice kinds (e.g.[]int,[]string, nested slices, named slice types,*[]int) now returnredis.Scan(unsupported …)and leave the destination field unchanged.Tests cover unsupported-slice errors and value preservation, byte-slice and pointer cases, and custom slice types that implement
ScanRedisorUnmarshalText.Reviewed by Cursor Bugbot for commit 610263a. Bugbot is set up for automated code reviews on this repo. Configure here.