An atomic operation makes one read, write or conditional update indivisible. Go's typed atomic values make the value type clear and provide methods such as Add, Load, Swap and CompareAndSwap. They are useful for an independent counter or state flag. They do not make a collection of related fields into one transaction. Use a mutex when several values must change together. These exercises keep the invariant small enough for one atomic integer. You will accumulate signed updates, claim a state only when the expected value matches and return a previous value during a swap. The checks distinguish the value before an operation from the value after it. Neither one is automatically the right answer; the function contract decides.
Atomic Add keeps signed deltas.