You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 themoney
instance, and be created in themoney
constructor.The text was updated successfully, but these errors were encountered: