(v int)
| 254 | } |
| 255 | |
| 256 | func (a *Account) Withdraw(v int) { |
| 257 | a.lock.Lock() |
| 258 | defer a.lock.Unlock() |
| 259 | if v > a.balance { |
| 260 | pl("Not enough money in account") |
| 261 | } else { |
| 262 | fmt.Printf("%d withdrawn : Balance : %d\n", |
| 263 | v, a.balance) |
| 264 | a.balance -= v |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | // ----- CLOSURES ----- |
| 269 | // Pass a function to a function |