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

zset member returned as an interface type instead of a string and is not type-safe #2817

Open
Aden-Q opened this issue Nov 29, 2023 · 4 comments · Fixed by #2818
Open

zset member returned as an interface type instead of a string and is not type-safe #2817

Aden-Q opened this issue Nov 29, 2023 · 4 comments · Fixed by #2818

Comments

@Aden-Q
Copy link

Aden-Q commented Nov 29, 2023

Expected Behavior

According to the redis doc, zset members should always be strings. We want zset members to be returned as strings so that we don't have to do type assertion explicitly.

Current Behavior

zset member is returned as an interface:

Member interface{}

Possible Solution

Define the Z struct's member field as a string type:

type Z struct {
Score float64
Member interface{}
}

Steps to Reproduce

Context (Environment)

Detailed Description

Possible Implementation

@Aden-Q Aden-Q changed the title zset member returned as an interface type instead of a string zset member returned as an interface type instead of a string and is not type-safe Nov 29, 2023
hugefiver added a commit to CSUSTers/csust-got that referenced this issue Dec 21, 2023
@szuecs
Copy link
Contributor

szuecs commented Jan 2, 2024

@chayim why this was a bug?
I would expect a breaking change only happens at major version updates.

@chayim
Copy link
Contributor

chayim commented Jan 4, 2024

@szuecs Honest mistake frankly. Happens sometimes.

@ofekshenawa IMHO we need to revert accordingly and release a 9.4.0 due to this. I would minor the bugfix

If we feel this breaking matters - we can stack it up for future v10.

@chayim chayim reopened this Jan 4, 2024
@ofekshenawa ofekshenawa added the v10 label Jan 4, 2024
@ofekshenawa
Copy link
Collaborator

Absolutely, I agree. We plan to release version 9.4.0 this Sunday, which will include the necessary fix.

@szuecs
Copy link
Contributor

szuecs commented Jan 4, 2024

Thanks!

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.

4 participants