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

Map counters' increments not working fine when updating more than one in the same request #17

Closed
tegioz opened this issue Aug 27, 2015 · 1 comment

Comments

@tegioz
Copy link

tegioz commented Aug 27, 2015

When incrementing some counters in a map in the same update request, all counters are incremented by the amount used in the last one that is processed in the loop. The pointer to the increment used while iterating the loop seems to be the problem (if it was passing just the value it would be ok, creating a copy does the trick).

Increment: &increment,

lukebakken pushed a commit that referenced this issue Aug 27, 2015
Issue where incrementing multiple counters in a map at once will use the last value. Due to golang-specific behavior with regard to range variables and pointers.
@lukebakken lukebakken mentioned this issue Aug 27, 2015
lukebakken pushed a commit that referenced this issue Aug 27, 2015
Issue where incrementing multiple counters in a map at once will use the last value. Due to golang-specific behavior with regard to range variables and pointers.
lukebakken added a commit that referenced this issue Aug 27, 2015
@lukebakken
Copy link
Contributor

Thank you for finding and reporting this 😄

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

No branches or pull requests

2 participants