From ba2fe6d41991c7ecc490d0d1c20c0037e8c23b55 Mon Sep 17 00:00:00 2001 From: Keith Gaughan Date: Sun, 9 Jun 2024 16:30:35 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --- internal/testutils/testutils.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/testutils/testutils.go b/internal/testutils/testutils.go index 05a3ebd..d334beb 100644 --- a/internal/testutils/testutils.go +++ b/internal/testutils/testutils.go @@ -36,16 +36,25 @@ func TempFile(content string, f func(*os.File)) { defer os.Remove(tmpfile.Name()) if _, err = tmpfile.WriteString(content); err != nil { + log.Printf("Error writing to temporary file: %v", err) + panic(err) + } panic(err) } if err = tmpfile.Sync(); err != nil { + log.Printf("Error syncing tmpfile: %v", err) + panic(err) + } panic(err) } f(tmpfile) if err = tmpfile.Close(); err != nil { + log.Printf("Error closing tmpfile: %v", err) + panic(err) + } panic(err) } }