aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-09-09 00:40:36 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-09-09 00:40:36 +0200
commitab48baf4fccedc85cf6bd42bcf15179ebb59c737 (patch)
tree5e3554a0f4a0f14d6e45aa35869bdc9ad04b6448 /main.go
parent643623dbecdc1ccb6f3ac77e4ebabdc6ca1d8d06 (diff)
Simplify ‘die()’
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 2 insertions, 6 deletions
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)
}