mirror of
https://github.com/Slug-Boi/cocommit.git
synced 2026-05-13 12:45:47 +00:00
refactor: use panic
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user