From 63893587cb41a1980318b60bf05fafbf433a24ab Mon Sep 17 00:00:00 2001 From: Grant Ammons Date: Sun, 24 Apr 2016 10:22:33 -0400 Subject: Organize things a bit better --- todolist/todo_item.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 todolist/todo_item.go (limited to 'todolist/todo_item.go') diff --git a/todolist/todo_item.go b/todolist/todo_item.go new file mode 100644 index 0000000..1319132 --- /dev/null +++ b/todolist/todo_item.go @@ -0,0 +1,22 @@ +package todolist + +import "time" + +type Todo struct { + Id int + Subject string + Projects []string + Contexts []string + Due string + FormattedDue time.Time + Completed bool + Archived bool +} + +func NewTodo() *Todo { + return &Todo{Completed: false, Archived: false} +} + +func (t Todo) Valid() bool { + return (t.Subject != "") +} -- cgit v1.3