Add creation time to new accounts

This commit is contained in:
Marc Di Luzio 2020-06-11 18:38:18 +01:00
parent 7d1a2d7efd
commit 537d309235

View file

@ -2,6 +2,7 @@ package internal
import (
"fmt"
"time"
)
const kAccountsFileName = "rove-accounts.json"
@ -45,6 +46,9 @@ func (a *Accountant) RegisterAccount(name string) (acc Account, err error) {
}
}
// Set the creation time
acc.Data["created"] = time.Now().String()
// Simply add the account to the map
a.Accounts[acc.Name] = acc