package main type model struct { todos []string // ALL items on the to-do list list []string // items currently visible on the list right now cursor int // which to-do list item our cursor is pointing at done map[int]struct{} // which to-do items are selected tab int // which tab is selected } func initialModel() model { return model{ // Start empty todos: []string{}, // start on today tab // 0: inbox, 1: today, 2: tomorrow, 3: scheduled, 4: anytime tab: 1, // A map which indicates which choices are selected. We're using // the map like a mathematical set. The keys refer to the indexes // of the `choices` slice, above. done: make(map[int]struct{}), } }