mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user