diff --git a/internal/app/quiz/app.go b/internal/app/quiz/app.go index 249332f..ade9fb4 100644 --- a/internal/app/quiz/app.go +++ b/internal/app/quiz/app.go @@ -80,7 +80,11 @@ func loadData(c config) quizData { Exit(1, fmt.Sprintf("Failed to open the CSV file: %q\n", c.fileName)) } - defer file.Close() + defer func() { + if err := file.Close(); err != nil { + fmt.Printf("Error closing file: %s\n", err) + } + }() r := csv.NewReader(file)