From 514ca2d4072af140362963f5ad15b4d7a9cf16b1 Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Tue, 22 Mar 2016 09:47:03 -0700 Subject: [PATCH] Fix go vet errors Signed-off-by: Kenfe-Mickael Laventure --- ctr/container.go | 11 +++-------- runtime/container_linux.go | 2 +- supervisor/supervisor.go | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ctr/container.go b/ctr/container.go index 809dfff..aa8d9e3 100644 --- a/ctr/container.go +++ b/ctr/container.go @@ -211,9 +211,7 @@ var startCommand = cli.Command{ } }() } - if err := waitForExit(c, events, id, "init", restoreAndCloseStdin); err != nil { - fatal(err.Error(), 1) - } + waitForExit(c, events, id, "init", restoreAndCloseStdin) } }, } @@ -491,9 +489,7 @@ var execCommand = cli.Command{ } }() } - if err := waitForExit(c, events, context.String("id"), context.String("pid"), restoreAndCloseStdin); err != nil { - fatal(err.Error(), 1) - } + waitForExit(c, events, context.String("id"), context.String("pid"), restoreAndCloseStdin) } }, } @@ -571,7 +567,7 @@ var updateCommand = cli.Command{ }, } -func waitForExit(c types.APIClient, events types.API_EventsClient, id, pid string, closer func()) error { +func waitForExit(c types.APIClient, events types.API_EventsClient, id, pid string, closer func()) { for { e, err := events.Recv() if err != nil { @@ -584,7 +580,6 @@ func waitForExit(c types.APIClient, events types.API_EventsClient, id, pid strin os.Exit(int(e.Status)) } } - return nil } type stdio struct { diff --git a/runtime/container_linux.go b/runtime/container_linux.go index 5b3a65d..f4f8765 100644 --- a/runtime/container_linux.go +++ b/runtime/container_linux.go @@ -416,7 +416,7 @@ func readLogMessages(path string) ([]message, error) { var m message if err := dec.Decode(&m); err != nil { if err == io.EOF { - return out, nil + break } return nil, err } diff --git a/supervisor/supervisor.go b/supervisor/supervisor.go index 9fe15d8..6b1ee4a 100644 --- a/supervisor/supervisor.go +++ b/supervisor/supervisor.go @@ -92,7 +92,7 @@ func readEventLog(s *Supervisor) error { var e Event if err := dec.Decode(&e); err != nil { if err == io.EOF { - return nil + break } return err }