Skip to content

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

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

Open
Aden-Q opened this issue Nov 29, 2023 · 6 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 · 6 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!

Copy link

github-actions bot commented Mar 6, 2025

This issue is marked stale. It will be closed in 30 days if it is not updated.

@github-actions github-actions bot added the Stale label Mar 6, 2025
@ndyakov
Copy link
Member

ndyakov commented Mar 21, 2025

So, this is still a breaking change and is Member is still an interface{}. Keeping this alive for v10

@github-actions github-actions bot removed the Stale label Mar 22, 2025
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.

5 participants