Fully Initialize on New

This commit is contained in:
Brian Buller 2023-08-23 11:29:45 -05:00
parent 5eb1d227a1
commit 82c2932988

View File

@ -16,7 +16,7 @@ type TodoList struct {
}
// Newtodolist creates a new empty todolist.
func NewTodoList() *TodoList { return &TodoList{} }
func NewTodoList() *TodoList { return &TodoList{Todos: []*Todo{}} }
func (todolist *TodoList) Size() int { return len(todolist.Todos) }
func (todolist *TodoList) GetTaskSlice() []*Todo { return todolist.Todos }