()
| 14 | } |
| 15 | |
| 16 | func initialModel() model { |
| 17 | return model{ |
| 18 | // Our to-do list is a grocery list |
| 19 | choices: []string{"Buy carrots", "Buy celery", "Buy kohlrabi"}, |
| 20 | |
| 21 | // A map which indicates which choices are selected. We're using |
| 22 | // the map like a mathematical set. The keys refer to the indexes |
| 23 | // of the `choices` slice, above. |
| 24 | selected: make(map[int]struct{}), |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | func (m model) Init() tea.Cmd { |
| 29 | return nil |