----- BANK ACCOUNT EXAMPLE ----- Here I'll simulate customers accessing a bank account and lock out customers to allow for individual access
| 243 | // bank account and lock out customers to |
| 244 | // allow for individual access |
| 245 | type Account struct { |
| 246 | balance int |
| 247 | lock sync.Mutex // Mutual exclusion |
| 248 | } |
| 249 | |
| 250 | func (a *Account) GetBalance() int { |
| 251 | a.lock.Lock() |
nothing calls this directly
no outgoing calls
no test coverage detected