go-by-test/wallet/wallet.go

16 lines
199 B
Go
Raw Normal View History

package wallet
2024-09-11 09:15:24 +00:00
type Bitcoin int
type Wallet struct {
2024-09-11 09:15:24 +00:00
balance Bitcoin
}
2024-09-11 09:15:24 +00:00
func (w *Wallet) Deposit(amount Bitcoin) {
w.balance += amount
}
2024-09-11 09:15:24 +00:00
func (w *Wallet) Balance() Bitcoin {
return w.balance
}