We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad17f3b commit 257fbebCopy full SHA for 257fbeb
cmd/envbox/main.go
@@ -2,6 +2,7 @@ package main
2
3
import (
4
"context"
5
+ "fmt"
6
"os"
7
"os/signal"
8
"runtime"
@@ -17,8 +18,8 @@ func main() {
17
18
sigs := make(chan os.Signal, 1)
19
signal.Notify(sigs, syscall.SIGTERM, syscall.SIGINT, syscall.SIGWINCH)
20
go func() {
- log := slog.Make(slogjson.Sink(os.Stderr))
21
ctx := context.Background()
22
+ log := slog.Make(slogjson.Sink(os.Stderr))
23
log.Info(ctx, "waiting for signal")
24
<-sigs
25
log.Info(ctx, "got signal")
@@ -38,6 +39,7 @@ func main() {
38
39
}()
40
_, err := cli.Root(ch).ExecuteC()
41
if err != nil {
42
+ _, _ = fmt.Fprintln(os.Stderr, err.Error())
43
os.Exit(1)
44
}
45
runtime.Goexit()
0 commit comments