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

Change SetJSON to correctly handle pointer args #63

Merged
merged 1 commit into from
Dec 18, 2018

Conversation

Shkurpylo
Copy link
Contributor

This fixes an issue with not grabbed goriakindex tags when we pass the pointer to SetJSON method.

Before this commit the behavior was:

  • call SetJSON with the pointer to a struct which has goriakindex tag.
  • under the hood, the method determinates kind of passed value as ptr and doesn't try to find the field with tag.
  • data are silently written into a bucket, without a secondary key.

In this commit added an extra check on pointer and data passed by pointer handled in the same way as data passed by value.
Test case included into the commit.

This fixes an issue with not grabbed `goriakindex` tags when we pass the pointer to SetJSON method.

Before this commit the behavior was:
- call SetJSON with the pointer to a struct which has `goriakindex` tag.
- under the hood, the method determinates kind of passed value as `ptr` and doesn't try to find the field with tag.
- data are silently written into a bucket, without a secondary key.

In this commit added an extra check on pointer and data passed by pointer handled in the same way as data passed by value.
Test case included into the commit.
@zegl
Copy link
Owner

zegl commented Dec 18, 2018

Hey @Shkurpylo, thanks for the great looking PR!

This is an unfortunate bug, I'll make a new release with this fix in it right now.

@zegl zegl merged commit cb710d4 into zegl:v3 Dec 18, 2018
@Shkurpylo
Copy link
Contributor Author

Hey @zegl, glad to help! Thank you for the useful project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants