Add creation time to new accounts
This commit is contained in:
parent
7d1a2d7efd
commit
537d309235
1 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,7 @@ package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
const kAccountsFileName = "rove-accounts.json"
|
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
|
// Simply add the account to the map
|
||||||
a.Accounts[acc.Name] = acc
|
a.Accounts[acc.Name] = acc
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue