replace panic with log.Fatal

This commit is contained in:
filifa 2024-09-04 21:38:23 -05:00
parent 82e2b05925
commit 54f1665325
1 changed files with 6 additions and 5 deletions

View File

@ -18,6 +18,7 @@ package cmd
import (
"errors"
"log"
"os"
"github.com/spf13/cobra"
@ -124,23 +125,23 @@ func update(m *milkDropWindow) (bool, error) {
func milkbucket(cmd *cobra.Command, args []string) {
err := checkStdin()
if err != nil {
panic(err)
log.Fatal(err)
}
err = sdl.Init(sdl.INIT_VIDEO)
if err != nil {
panic(err)
log.Fatal(err)
}
defer sdl.Quit()
err = validatePresets()
if err != nil {
panic(err)
log.Fatal(err)
}
m, err := newMilkDropWindow(800, 600, presets)
if err != nil {
panic(err)
log.Fatal(err)
}
defer m.destroy()
@ -150,7 +151,7 @@ func milkbucket(cmd *cobra.Command, args []string) {
for running {
running, err = update(m)
if err != nil {
panic(err)
log.Fatal(err)
}
}
}