I'm a little confused on how mutex's work in Golang, even though I've used them before.
Here are my questions:
What exactly does a mutex lock? (How) Do you use it to lock a specific variable only?
Should I use channels instead of a mutex?
Is there a difference between a mutex and a locker?
I'm developing a highly concurrent website with golang, and I need to manage each person's wallet at different times and I am trying to avoid any races in my program. For example, if my program wants to add 500 credits to a user, it will read the current balance for the user (from firebase) and add 500 then update the value. But if it does this twice for some reason, there may be an incorrect change to the user's wallet.