From e8933bc764ca62b9e706a83bd069a31f7c00dcfe Mon Sep 17 00:00:00 2001 From: Slug-Boi Date: Thu, 10 Apr 2025 12:16:57 +0200 Subject: [PATCH] refactor: use panic --- src/cmd/tui/tui_show_users.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cmd/tui/tui_show_users.go b/src/cmd/tui/tui_show_users.go index 7269d43..c850657 100644 --- a/src/cmd/tui/tui_show_users.go +++ b/src/cmd/tui/tui_show_users.go @@ -87,8 +87,7 @@ func intialModel_US(author_file string) tea.Model { model, err := newExample() if err != nil { - fmt.Println("Could not initialize Bubble Tea model:", err) - os.Exit(1) + panic(fmt.Sprintf("Could not initialize Bubble Tea model: %v", err)) } return model } @@ -96,8 +95,7 @@ func intialModel_US(author_file string) tea.Model { func loadData(author_file string) { file, err := os.Open(author_file) if err != nil { - fmt.Println("Could not open file:", err) - os.Exit(1) + panic(fmt.Sprintf("Could not open author file: %v", err)) } scanner := bufio.NewScanner(file)