MCPcopy Create free account
hub / github.com/charmbracelet/bubbletea / initialModel

Function initialModel

tutorials/basics/main.go:16–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14}
15
16func 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
28func (m model) Init() tea.Cmd {
29 return nil

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected