14 lines
167 B
Go
14 lines
167 B
Go
|
package wallet
|
||
|
|
||
|
type Wallet struct {
|
||
|
balance int
|
||
|
}
|
||
|
|
||
|
func (w *Wallet) Deposit(units int) {
|
||
|
w.balance += units
|
||
|
}
|
||
|
|
||
|
func (w *Wallet) Balance() int {
|
||
|
return w.balance
|
||
|
}
|