From: Tom Clegg Date: Tue, 10 Mar 2020 14:40:45 +0000 (-0400) Subject: 15954: Fix style, handle errors first. X-Git-Tag: 2.1.0~273^2~5 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/c04ba156f832774ace933d4fc001cb18ad4164c3 15954: Fix style, handle errors first. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- diff --git a/lib/boot/cmd.go b/lib/boot/cmd.go index 60955dfa0f..43b3ab6731 100644 --- a/lib/boot/cmd.go +++ b/lib/boot/cmd.go @@ -77,12 +77,12 @@ func (bootCommand) RunCommand(prog string, args []string, stdin io.Reader, stdou super.Start(ctx, cfg) defer super.Stop() - if url, ok := super.WaitReady(); ok { - fmt.Fprintln(stdout, url) - // Wait for signal/crash + orderly shutdown - <-super.done - return 0 - } else { + url, ok := super.WaitReady() + if !ok { return 1 } + fmt.Fprintln(stdout, url) + // Wait for signal/crash + orderly shutdown + <-super.done + return 0 }