Return an error if we could not initialize a new gradient ramp

This commit is contained in:
Christian Rocha
2020-11-18 18:33:45 -05:00
committed by Christian Rocha
parent 5d6d8cb0fb
commit f48e53556a
2 changed files with 34 additions and 19 deletions

View File

@@ -18,9 +18,11 @@ const (
)
func main() {
progress := progress.NewModel(
progress.WithDefaultRamp(),
)
progress, err := progress.NewModel(progress.WithDefaultRamp())
if err != nil {
fmt.Println("Could not initialize progress model:", err)
os.Exit(1)
}
if err := tea.NewProgram(example{progress: progress}).Start(); err != nil {
fmt.Println("Oh no!", err)