diff --git a/main.go b/main.go index 3cbfbf5..c2030c1 100644 --- a/main.go +++ b/main.go @@ -7,7 +7,7 @@ import ( ) func PrintMenu() { - fmt.Printf("### TODO APP ###\n") + fmt.Printf("\n\n### TODO APP ###\n") fmt.Printf("1: List Todo\n") fmt.Printf("2: Add Todo\n") fmt.Printf("3: Remove Todo (via index)\n") @@ -51,7 +51,7 @@ func main() { fmt.Printf("Which TODO to remove?\n> ") if _, err := fmt.Scanf("%d", &index); err != nil { - fmt.Printf("Invalid input\n> ") + fmt.Printf("Which TODO to remove?\n> ") } if err := list.RemoveTodo(index); err != nil { @@ -65,43 +65,4 @@ func main() { PrintMenu() } } - - /* - list := Todos{} - //todos := []Todo{} - //list := Todos{todos} - fmt.Println("Empty list: ") - list.ListTodo() - - fmt.Println("Adding entries...") - items := []Todo{ - { - Title: "test", - Content: "Here is some content", - }, - { - Title: "test1", - Content: "Here is some more content", - }, - { - Title: "test2", - Content: "Here is even MORE content", - }, - } - - //Add the items for testing - for item := range items { - list.AddTodo(items[item]) - } - - fmt.Println("Listing...") - list.ListTodo() - fmt.Println("Listing again...") - list.ListTodo() - - fmt.Println("Removing item2 via index 1") - list.RemoveTodo(1) - fmt.Println("Listing again...") - list.ListTodo() - */ } diff --git a/todo b/todo index d308c86..e270749 100755 Binary files a/todo and b/todo differ diff --git a/todo.go b/todo.go index 5b8b379..244d7d0 100644 --- a/todo.go +++ b/todo.go @@ -25,7 +25,7 @@ func (todo *Todos) RemoveTodo(index int) (err error) { } if index > len(todo.Items) { - return errors.New("[ERR] Index out of bounds") + return errors.New("[ERR] Index out of bounds\n") } todo.Items = append(todo.Items[:index], todo.Items[index+1:]...)