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

Global calculator variable will cause races #16

Closed
tylerstillwater opened this issue Apr 18, 2017 · 2 comments · Fixed by #17
Closed

Global calculator variable will cause races #16

tylerstillwater opened this issue Apr 18, 2017 · 2 comments · Fixed by #17

Comments

@tylerstillwater
Copy link
Contributor

Right now there is a calculator variable that is global and created anew every time a money instance is created.

This is an issue and will cause races. Multiple money objects being created and used on multiple goroutines will cause indeterminate results due to the races.

The calculator instance should be inside the money instance, and be created in the money constructor.

@tylerstillwater
Copy link
Contributor Author

I can submit a PR for this once #15 is merged.

@Rhymond
Copy link
Owner

Rhymond commented Apr 18, 2017

@tylerb merged and new release (v0.3.0) was created

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 a pull request may close this issue.

2 participants