Skip to content

Commit

Permalink
Remove useless interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Bishop committed Mar 20, 2022
1 parent 1e015c4 commit aa1ae6c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
4 changes: 0 additions & 4 deletions ledger/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,3 @@ type TxItem struct {

BalanceAssertion float64
}

type Source interface {
Transactions() <-chan Transaction
}
9 changes: 1 addition & 8 deletions scope/datafile.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/Bishop/abilitycash2ledger/ability_cash"
"github.com/Bishop/abilitycash2ledger/ability_cash/schema"
"github.com/Bishop/abilitycash2ledger/ledger"
)

type datafile struct {
Expand Down Expand Up @@ -52,9 +51,7 @@ func (d *datafile) export(s *scope) (err error) {
Db: d.db,
}

if err = d.exportTxs(converter); err != nil {
return
}
err = d.exportEntity("txs", converter.Transactions())

// $ ledger accounts
if err = d.exportEntity("accounts", converter.AccountsList()); err != nil {
Expand All @@ -64,10 +61,6 @@ func (d *datafile) export(s *scope) (err error) {
return
}

func (d *datafile) exportTxs(source ledger.Source) error {
return d.exportEntity("txs", source.Transactions())
}

func (d *datafile) exportEntity(entityName string, data interface{}) error {
format := fmt.Sprintf("%%-%ds", 60)

Expand Down

0 comments on commit aa1ae6c

Please sign in to comment.