cmd/dockerd: main(): remove "onError" func

Remove the redundant abstraction; just inline it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-11-06 00:53:49 +01:00
parent 9e350b6832
commit 0678de9c87

View File

@@ -26,16 +26,14 @@ func main() {
// Set terminal emulation based on platform as required.
_, stdout, stderr := term.StdStreams()
onError := func(err error) {
_, _ = fmt.Fprintln(stderr, err)
os.Exit(1)
}
r, err := command.NewDaemonRunner(stdout, stderr)
if err != nil {
onError(err)
_, _ = fmt.Fprintln(stderr, err)
os.Exit(1)
}
if err := r.Run(ctx); err != nil {
onError(err)
_, _ = fmt.Fprintln(stderr, err)
os.Exit(1)
}
}