-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Can't get UUID with Scan() #3139
Comments
Can I contribute to this by adding support for |
ofekshenawa
added a commit
to zeze1004/go-redis
that referenced
this issue
Dec 5, 2024
zeze1004
added a commit
to zeze1004/go-redis
that referenced
this issue
Jan 22, 2025
ndyakov
added a commit
to zeze1004/go-redis
that referenced
this issue
Feb 7, 2025
zeze1004
added a commit
to zeze1004/go-redis
that referenced
this issue
Feb 7, 2025
ndyakov
added a commit
to zeze1004/go-redis
that referenced
this issue
Feb 10, 2025
ndyakov
added a commit
to zeze1004/go-redis
that referenced
this issue
Feb 27, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
Can use UUID type for storing structs in hash tables
Current Behavior
Got
invalid UUID length: 16
error from (uuid *UUID) UnmarshalTextPossible Solution
Add
encoding.BinaryUnmarshaler
to switch case at/internal/hscan/structmap.go:107
Steps to Reproduce
Detailed Description
I am facing a problem related to hash tables. I want to store objects in it, so I use HSet. Then
encoding.BinaryMarshaler
is used to marshal the UUID, but when I try to get the object back using Scan(),encoding.TextUnmarshaler
is used instead ofencoding.BinaryUnmarshaler
to unmarshal it.This is a incorrect use of these interfaces. As it is written in the description of these interfaces
And
They are not interchangeable and Binary should be used with Binary and Text with Text
The text was updated successfully, but these errors were encountered: