memory repo: allow init with existing data

This commit is contained in:
ari melody 2026-07-31 10:35:51 +01:00
parent 8bd1c556fb
commit 6eb204bfce
Signed by: ari
GPG key ID: CF99829C92678188
2 changed files with 3 additions and 3 deletions

View file

@ -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) {