Adding storage to our data

This commit is contained in:
2026-09-14 10:58:24 -04:00
parent b85c4c805a
commit 97ef735fc8
5 changed files with 93 additions and 23 deletions
+10 -8
View File
@@ -2,13 +2,15 @@ package main
func main() {
todos := Todos{}
todos.add("Learn more Go")
todos.add("You have to understand the code you are writing")
todos.add("You have to understand the code you are writing")
todos.toggle(0)
todos.delete(2)
storage := newStorage[Todos]("Tasks.json")
storage.load(&todos)
todos.print()
todos.toggle(1)
todos.print()
todos.delete(2)
todos.edit(0, "yeah yeah, do better")
todos.toggle(0)
todos.toggle(2)
todos.print()
storage.save(todos)
}