From 1545ea69b7688872f2233d4ff333fd1b02367f47 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Wed, 4 Aug 2021 20:08:40 -0700 Subject: [PATCH] delete, start: remove newline from errors Error messages should not usually contain newlines. Testing shows that the error runc delete prints is the same before and after this commit: [kir@kir-rhat runc-tst]$ sudo ../runc/runc delete xx3 ERRO[0000] cannot delete container xx3 that is not stopped: running [kir@kir-rhat runc-tst]$ Signed-off-by: Kir Kolyshkin --- delete.go | 2 +- start.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/delete.go b/delete.go index 6e6b463ef..746b0df54 100644 --- a/delete.go +++ b/delete.go @@ -79,7 +79,7 @@ status of "ubuntu01" as "stopped" the following will delete resources held for if force { return killContainer(container) } - return fmt.Errorf("cannot delete container %s that is not stopped: %s\n", id, s) + return fmt.Errorf("cannot delete container %s that is not stopped: %s", id, s) } return nil diff --git a/start.go b/start.go index 3a1769a43..338737c0a 100644 --- a/start.go +++ b/start.go @@ -48,7 +48,7 @@ your host.`, case libcontainer.Running: return errors.New("cannot start an already running container") default: - return fmt.Errorf("cannot start a container in the %s state\n", status) + return fmt.Errorf("cannot start a container in the %s state", status) } }, }