Files
2019-12-17 07:25:03 +11:00

18 lines
420 B
Go

package commands
import (
"github.com/sirupsen/logrus"
"github.com/wahyd4/cash/domains"
)
// TotalBalanceCommand for getting the balance
type TotalBalanceCommand struct {
}
// Run gets the balance for a specific account when account is not nil, otherwise for the bank
func (command *TotalBalanceCommand) Run(bank *domains.Bank) error {
logrus.Infof("the total balance is %.2f", bank.TotalBalance())
return nil
}