cleanup and add title

This commit is contained in:
2022-07-14 16:13:27 -04:00
parent 5a8af2699b
commit e2ac680121
3 changed files with 15 additions and 14 deletions

View File

@@ -31,7 +31,6 @@ type Item struct {
}
type Jdb struct {
Foo string `json:"-"`
Items []Item `json:"items"`
}
@@ -73,7 +72,7 @@ func (d *Db) Transact(id int, persist bool, f func(*Item)) error {
}
func (d *Db) save() error {
data, err := json.Marshal(Jdb{"", d.items})
data, err := json.Marshal(Jdb{d.items})
if err != nil {
return err
}
@@ -83,7 +82,7 @@ func (d *Db) save() error {
func (d *Db) Run(f func(*Jdb)) {
d.mutex.Lock()
defer d.mutex.Unlock()
f(&Jdb{"", d.items})
f(&Jdb{d.items})
}
func (d *Db) Save() error {