Skip to content

Go: Fix ZAddIncr Return Type - #4190

Merged
edlng merged 2 commits into
valkey-io:release-2.0from
Bit-Quill:go/edlng-fix-zaddincr-return
Jun 13, 2025
Merged

edlng merged 2 commits into
valkey-io:release-2.0from
Bit-Quill:go/edlng-fix-zaddincr-return

Conversation

@edlng

@edlng edlng commented Jun 13, 2025

Copy link
Copy Markdown
Collaborator

Issue

Command returns a nil or int, but doc doesnt say when null is returned.

PR Description

In reality, ZAddIncr without options will never return nil. This aligns with the Java client's implementation. We should update it to reflect this fact.

@Override
public CompletableFuture<Double> zaddIncr(
@NonNull String key, @NonNull String member, double increment) {
String[] arguments =
concatenateArrays(
new String[] {key}, new String[] {"INCR", Double.toString(increment), member});
return commandManager.submitNewCommand(ZAdd, arguments, this::handleDoubleResponse);
}

Issue link

This Pull Request is linked to issue (URL): #4070

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.

Signed-off-by: Edward Liang <edward.liang@improving.com>
@edlng
edlng requested a review from a team as a code owner June 13, 2025 21:12
@edlng edlng added the go 🏃 golang wrapper label Jun 13, 2025
@edlng
edlng changed the base branch from main to release-2.0 June 13, 2025 21:12
Signed-off-by: Edward Liang <edward.liang@improving.com>
@yipin-chen yipin-chen mentioned this pull request Jun 13, 2025
31 tasks
@edlng
edlng merged commit cc784fd into valkey-io:release-2.0 Jun 13, 2025
@edlng
edlng deleted the go/edlng-fix-zaddincr-return branch June 13, 2025 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go 🏃 golang wrapper

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants