leo
9ab2d0ae0b
* add log messages telling the user what went wrong if the app fails to start * improve existing log messages * cleanup: close channels when exiting * cleanup: stop listening for signals when exiting
17 lines
236 B
Go
17 lines
236 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"golang.org/x/exp/slog"
|
|
)
|
|
|
|
func main() {
|
|
err := run()
|
|
if err != nil {
|
|
l := slog.New(slog.NewJSONHandler(os.Stderr))
|
|
l.Error("unrecoverable failure, stopping the app", "error", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|