diff options
| author | Grant Ammons <gammons@gmail.com> | 2017-03-07 08:50:00 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-07 08:50:00 -0500 |
| commit | b735a0cc90c6df666f59b7ee302dae27a6a7afeb (patch) | |
| tree | 8dc6d5376e1bf422a1aa693c27f505721741a1f0 /todolist/app.go | |
| parent | 34931b46ed9ebb06e9555d6e62c98c70dc460d59 (diff) | |
| parent | 5763376a7ef50a116f9585ffd280bbf8e37621d3 (diff) | |
Merge pull request #37 from gammons/garbage-collect
Add garbage collection feature
Diffstat (limited to 'todolist/app.go')
| -rw-r--r-- | todolist/app.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/todolist/app.go b/todolist/app.go index 495d087..a9145a1 100644 --- a/todolist/app.go +++ b/todolist/app.go @@ -205,6 +205,13 @@ func (a *App) getGroups(input string, todos []*Todo) *GroupedTodos { return grouped } +func (a *App) GarbageCollect() { + a.Load() + a.TodoList.GarbageCollect() + a.Save() + fmt.Println("Garbage collection complete.") +} + func (a *App) Load() error { todos, err := a.TodoStore.Load() if err != nil { |
