aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'todolist/app.go')
-rw-r--r--todolist/app.go7
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 {