Skip to content

feat: add support for binary UUID encoding in scan#3725

Open
yash9263 wants to merge 1 commit into
redis:masterfrom
yash9263:3425-support-uuid-with-scan
Open

feat: add support for binary UUID encoding in scan#3725
yash9263 wants to merge 1 commit into
redis:masterfrom
yash9263:3425-support-uuid-with-scan

Conversation

@yash9263

@yash9263 yash9263 commented Feb 27, 2026

Copy link
Copy Markdown

fixes: #3139

Adds support to read UUID via encoding.BinaryUnmarshaler.


Note

Medium Risk
Changes hscan struct field scanning behavior to prefer encoding.BinaryUnmarshaler when present, which could affect existing types that implement multiple unmarshal interfaces. Impact is scoped to Redis hash/scan decoding paths but touches core decoding logic.

Overview
Adds support for scanning Redis hash values into struct fields that implement encoding.BinaryUnmarshaler, enabling binary UUID-style decoding during Scan/HGetAll().Scan().

Updates the hscan struct scanner dispatch in internal/hscan/structmap.go and adds coverage in both internal/hscan/hscan_test.go and commands_test.go to validate round-tripping a 16-byte ID via binary marshal/unmarshal.

Written by Cursor Bugbot for commit 815d7bc. This will update automatically on new commits. Configure here.

@jit-ci

jit-ci Bot commented Feb 27, 2026

Copy link
Copy Markdown

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@ndyakov

ndyakov commented Feb 28, 2026

Copy link
Copy Markdown
Member

Hello @yash9263 , this would be a breaking change and we will look into including it in v10. Thank you!

@ndyakov ndyakov added the v10 label Feb 28, 2026
@yash9263

Copy link
Copy Markdown
Author

Hi @ndyakov, thanks for taking a look. Please let me know if any changes are needed to get it ready for v10.
Thanks!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't get UUID with Scan()

2 participants