From 71051ce7f0df465876a5efa990ff536cb71f8934 Mon Sep 17 00:00:00 2001 From: Rockingcool Date: Sat, 10 Aug 2024 11:12:23 -0500 Subject: [PATCH] Wrote function to print an error and exit the program --- errors.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 errors.go diff --git a/errors.go b/errors.go new file mode 100644 index 0000000..12faec6 --- /dev/null +++ b/errors.go @@ -0,0 +1,11 @@ +package main + +import ( + "fmt" + "os" +) + +func printAndExit(errorStr string) { + fmt.Printf("ERROR: %s\n", errorStr) + os.Exit(1) +}