memory repo: allow init with existing data
This commit is contained in:
parent
8bd1c556fb
commit
6eb204bfce
2 changed files with 3 additions and 3 deletions
|
|
@ -13,8 +13,8 @@ type AccountRepositoryMemory struct {
|
|||
|
||||
var _ AccountRepository = new(AccountRepositoryMemory)
|
||||
|
||||
func NewAccountRepositoryMemory() *AccountRepositoryMemory {
|
||||
return &AccountRepositoryMemory{ accounts: make([]*model.Account, 0) }
|
||||
func NewAccountRepositoryMemory(accounts []*model.Account) *AccountRepositoryMemory {
|
||||
return &AccountRepositoryMemory{ accounts: accounts }
|
||||
}
|
||||
|
||||
func (repo *AccountRepositoryMemory) GetAll() ([]*model.Account, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue