1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 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 != "") }