aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Ammons <gammons@gmail.com>2017-03-27 08:45:25 -0400
committerGrant Ammons <gammons@gmail.com>2017-03-27 08:45:25 -0400
commit4feca9dcb85823e9fc000a46a8bdb465a0d0c43d (patch)
treea0fbcd586e40d54255820b0ddbee6db359987e7d
parent40be25720ac4686ca07db0b3b7f18ceb39776eb6 (diff)
Show the id after creating a todo
-rw-r--r--todolist/app.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/todolist/app.go b/todolist/app.go
index a9145a1..880390e 100644
--- a/todolist/app.go
+++ b/todolist/app.go
@@ -31,9 +31,10 @@ func (a *App) AddTodo(input string) {
return
}
+ id := a.TodoList.NextId()
a.TodoList.Add(todo)
a.Save()
- fmt.Println("Todo added.")
+ fmt.Printf("Todo %d added.\n", id)
}
func (a *App) DeleteTodo(input string) {