reduce howeyc
This commit is contained in:
@@ -22,17 +22,17 @@ type Delta struct {
|
||||
func newDeltas(t *ledger.Transaction) []Delta {
|
||||
result := make([]Delta, len(t.AccountChanges))
|
||||
for i, a := range t.AccountChanges {
|
||||
result[i] = newDelta(t.Date, a)
|
||||
value, _ := a.Balance.Float64()
|
||||
result[i] = newDelta(t.Date, a.Name, value)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func newDelta(d time.Time, a ledger.Account) Delta {
|
||||
value, _ := a.Balance.Float64()
|
||||
func newDelta(d time.Time, a string, v float64) Delta {
|
||||
return Delta{
|
||||
Date: d,
|
||||
Account: a.Name,
|
||||
Value: value,
|
||||
Account: a,
|
||||
Value: v,
|
||||
Currency: USD, // TODO
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user