From 16bbf5d07f712aa887962250c7e437a48b1607a3 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 24 Jan 2026 15:14:12 +0100 Subject: [PATCH] cli/command/container: cidFile.Write: include CID in error message Include the container-ID in the error message when failing to write the ID to a file, so that the user can still find the ID of the container that was created. Signed-off-by: Sebastiaan van Stijn --- cli/command/container/create.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/command/container/create.go b/cli/command/container/create.go index 3c773e1a47..6453a60998 100644 --- a/cli/command/container/create.go +++ b/cli/command/container/create.go @@ -188,8 +188,8 @@ func (cid *cidFile) Write(id string) error { if cid.file == nil { return nil } - if _, err := cid.file.Write([]byte(id)); err != nil { - return fmt.Errorf("failed to write the container ID to the file: %w", err) + if _, err := cid.file.WriteString(id); err != nil { + return fmt.Errorf("failed to write the container ID (%s) to file: %w", id, err) } cid.written = true return nil