1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
package todolist type Todo struct { Id string Subject string Projects []string Contexts []string Due string Completed bool Archived bool } func NewTodo() *Todo { return &Todo{Completed: false, Archived: false} } func (t Todo) Valid() bool { return (t.Subject != "") }