Print error (and exit) if there's trouble when starting the example program

This commit is contained in:
Christian Rocha
2020-01-11 10:45:15 -05:00
parent 293c2f6696
commit d9cf7d1477

View File

@@ -9,7 +9,9 @@ type Model int
func main() {
p := tea.NewProgram(0, update, view)
p.Start()
if err := p.Start(); err != nil {
fmt.Println("could not start program:", err)
}
}
func update(msg tea.Msg, model tea.Model) (tea.Model, tea.Cmd) {