From c2114f083afeb1ac2cc28e9a83f3a9c591b59a1f Mon Sep 17 00:00:00 2001 From: Grant Ammons Date: Fri, 3 Mar 2017 18:30:06 -0500 Subject: Add priority feature Now, todos have a priority flag. When listed, these todos will be bolded and italic. You can list todos by priority by running `todolist l p`. --- todolist/todo_item.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'todolist/todo_item.go') diff --git a/todolist/todo_item.go b/todolist/todo_item.go index 6b820b1..273df8d 100644 --- a/todolist/todo_item.go +++ b/todolist/todo_item.go @@ -3,17 +3,18 @@ package todolist import "time" type Todo struct { - Id int `json:"id"` - Subject string `json:"subject"` - Projects []string `json:"projects"` - Contexts []string `json:"contexts"` - Due string `json:"due"` - Completed bool `json:"completed"` - Archived bool `json:"archived"` + Id int `json:"id"` + Subject string `json:"subject"` + Projects []string `json:"projects"` + Contexts []string `json:"contexts"` + Due string `json:"due"` + Completed bool `json:"completed"` + Archived bool `json:"archived"` + IsPriority bool `json:"isPriority"` } func NewTodo() *Todo { - return &Todo{Completed: false, Archived: false} + return &Todo{Completed: false, Archived: false, IsPriority: false} } func (t Todo) Valid() bool { -- cgit v1.3