From ab48baf4fccedc85cf6bd42bcf15179ebb59c737 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 9 Sep 2023 00:40:36 +0200 Subject: Simplify ‘die()’ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 3a39852..1da9ba1 100644 --- a/main.go +++ b/main.go @@ -27,11 +27,7 @@ func main() { fmt.Print("\n") } -func die(strings ...any) { - fmt.Fprint(os.Stderr, os.Args[0]) - for _, s := range strings { - fmt.Fprintf(os.Stderr, ": %v", s) - } - fmt.Fprint(os.Stderr, "\n") +func die(e error) { + fmt.Fprintf(os.Stderr, "%s: %s\n", os.Args[0], e) os.Exit(1) } -- cgit v1.2.3