diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-09-09 00:40:36 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-09-09 00:40:36 +0200 |
commit | ab48baf4fccedc85cf6bd42bcf15179ebb59c737 (patch) | |
tree | 5e3554a0f4a0f14d6e45aa35869bdc9ad04b6448 | |
parent | 643623dbecdc1ccb6f3ac77e4ebabdc6ca1d8d06 (diff) |
Simplify ‘die()’
-rw-r--r-- | main.go | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -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) } |