use CheckErr

This commit is contained in:
filifa 2024-09-07 19:45:50 -05:00
parent 6a85dcb816
commit ebb4d7102b
1 changed files with 4 additions and 5 deletions

View File

@ -20,7 +20,6 @@ import (
"encoding/binary" "encoding/binary"
"errors" "errors"
"io" "io"
"log"
"os" "os"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -148,18 +147,18 @@ func update(m *milkDropWindow) (bool, error) {
func milkbucket(cmd *cobra.Command, args []string) { func milkbucket(cmd *cobra.Command, args []string) {
err := checkStdin() err := checkStdin()
if err != nil { if err != nil {
log.Fatal(err) cobra.CheckErr(err)
} }
err = sdl.Init(sdl.INIT_VIDEO) err = sdl.Init(sdl.INIT_VIDEO)
if err != nil { if err != nil {
log.Fatal(err) cobra.CheckErr(err)
} }
defer sdl.Quit() defer sdl.Quit()
m, err := newMilkDropWindow(800, 600, args) m, err := newMilkDropWindow(800, 600, args)
if err != nil { if err != nil {
log.Fatal(err) cobra.CheckErr(err)
} }
defer m.destroy() defer m.destroy()
@ -171,7 +170,7 @@ func milkbucket(cmd *cobra.Command, args []string) {
for running { for running {
running, err = update(m) running, err = update(m)
if err != nil { if err != nil {
log.Fatal(err) cobra.CheckErr(err)
} }
} }
} }